Electric Generator works on the principle of Faraday law which says
"The induced electromotive force in any closed circuit is equal to the negative of the time rate of change of the magnetic flux enclosed by the circuit."
So in short we rotate a electric circuit in a magnetic field which brings the change in the magnetic field of the circuit and induces the electromotive force which we call the electricity.
Please comment if still not very clear...