A modeling framework for adaptive lifelong learning with transfer and savings through gating in the prefrontal cortex