How Brain Waves Guide Memory Formation