CORE: Mitigating Catastrophic Forgetting in Continual Learning through Cognitive Replay