What device changes mechanical energy to electrical energy by rotating a coil of wire through a magnetic field?

That's an electrical generator, whether the mechanical energy comes from steam or water flowing through a turbine, or wind, or tides.
That's an electrical generator, whether the mechanical energy comes from steam or water flowing through a turbine, or wind, or tides.