Explaining heterogeneity in medial entorhinal cortex with task-driven neural networks