How the Brain and AI Overcome Forgetting