A generative model of the hippocampal formation trained with theta driven local learning rules