A generator starts with mechanical energy and is surrounded by wiring. A magnet moving near a wire produces electrical energy.
A Generator consists of wiring wound around a rotating armature that is spinning between magnets that produce a magnetic field. This produces electric current by exciting the free radical electrons in the atoms that make up the wire, forcing them to move in one direction.
That is to say a generator is a device which converts mechanical energy into electrical energy.