Learning and consolidation across memory systems in brains and machines