Graph-Based Continual Learning