EpMAN: Episodic Memory AttentioN for Generalizing to Longer Contexts