How are electric motors and electric generators the same?