It is the other way around in a motor. They both have coils of wire, a turning mechanism, and magnetic fields. Falling water, wind, or steam. A constantly changing electromagnetic field is necessary and that is provided by alternating current. A transformer transforms voltage and current to different amounts.
Energy is transferred, but conserved.
A transformer needs a constantly changing electromagnetic field and that is accomplished with alternating current. The energy total with heat stays constant. Induced currents cannot be produced in the nylon strings. A cyclist will coast farther if the lamp is disconnected from the generator. The energy that goes into lighting the lamp is taken from the bike's kinetic energy, so the bike slows down.