Quantum non-Markovianity and localization