A Common Task Structure Links Together the Fate of Different Types of Memories