Real-time observation of nanowire lithiation for energy storage