Scientists watch glowing molecules form memories in real time