Formalizing the Generalization-Forgetting Trade-off in Continual Learning