Anatomy of Catastrophic Forgetting: Hidden Representations and Task Semantics