There is growing concern that AI can blunt memory and reasoning. But science shows ways to keep the brain sharp.