how does an electric locomotive work