A Unified and General Framework for Continual Learning