Identifying nonlinear dynamical systems via generative recurrent neural networks with applications to fMRI