To answer this question, first we must define the word "electricity." Unfortunately, there is no single definition upon which experts all agree. Therefore, asking about "electricity" can only give confusing and obscure answers. (See the tldr; down below.)
First, the physics definition: "electricity" is the large quantity of mobile electrons of the copper atoms inside the wires. Quantities of electricity are to be measured in coulombs. The word "electricity" means electric charge. Whenever this type of "electricity' moves along, its flow is called "electric current," and is measured in coulombs/sec or Amperes. This is the NIST definition, part of the SI physics-units and the metric system.
But most low-level textbooks disagree totally with the above.
Instead, they insist that "electricity" is a form of energy. They say "electricity" is the joules, not the coulombs. In that case, a flow of electricity is measured in watts, not amperes. In that case, electricity is photons (since the energy in electric circuits is the EM waves; the propagating energy stored in the e-fields and b-fields surrounding circuits.) This kind of "electricity" is much like a low-frequency radio-wave, it moves at the speed of light, and is found in the space surrounding the wires or power lines. It never travels inside wires, instead it travels in the plastic insulation. When this energy flows along, the flow-rate is expressed in joules/sec.
And then, a different group of textbooks insists that "electricity" is the motion of the electrons in the wire. In other words, electricity the amperes. In that case an electric current is not a flow of electricity. Instead, the flowing motion itself is the electricity! Electricity is not like a stuff, instead it's a rate. When electrons stop moving, the amperes go to zero, and the "electricity" vanishes. Yet the electrons are still sitting right there in the wires. But this kind of "electricity" isn't made of electrons or charge, this electricity is the flow-rate, it's the charge-motion. If we move some electrons then electricity appears, stop them and the electricity winks out. (So, electricity is not like air, instead it's more like wind. It's like currents inside a water tank, but it's not like water.)
But under the SI/NIST definition, "electricity" certainly is like air and not like wind. The textbooks are ignoring physics standard definitions of words.
What then does the word "electricity" actually mean?
If we ignore the low-level textbooks, and instead follow the centuries-old scientific definition, then we're forced to say that all wires are full of electricity all the time, because metals are partly made of electricity. Atoms contain equal quantities of positive electricity and negative electricity. In an AC system this electricity moves back and forth, and it never travels from dynamos to distant users. Nobody ever "generates" this type of electricity, instead it only travels in complete circles with no beginning or end. The wires supply it, and a dynamo or battery is an electricity-pump.
And in a simple flashlight, the same amount of electricity is always there ...but when we turn on the switch, the electricity starts moving slowly in a circle, like a flywheel, or like a rotating drive-belt. Closing the switch has enabled the battery's pumping action, and has created a current, but it didn't create any electricity.
Don't like that picture?
Well, then ask yourself this: is electricity something like wind, or instead, is it something like the air? Or, is electricity made of energy, like sound-waves traveling through the air? Three different things, three choices.
We can't look to books for an answer, because their authors figure that, since it's invisible, it all must be one single thing! One author says it's like wind (electricity is the flow,) another says it's like air (electricity is the stuff that does the flowing,) while another says it's the energy (it's wave-motion that propagates almost instantly from place to place.) Taken together, they're essentially saying that nitrogen is sound, and that air molecules are made out of wind. Or something. Amperes equal watts equal coulombs? Which one measures the "quantity of electricity?" It's just a messy swamp of ignorance.
My own recommendation: strike out the word "electricity," and never mention it again.
Then if you want to use the scientific definition, just say "charge" or "coulombs."
TLDR; Your question then becomes: "How are coulombs created in the practical sense?" Answer: they aren't, since the coulombs are supplied by the substance of the wires. During an electric current, it's the electron-sea of the metals which flows along. (Or, in salt water and in human bodies, it's the dissolved sodium and chloride ions which flow during an electric current.) The mobile coulombs are always there inside any conductor. A dynamo or generator or battery is just a charge-pump, and doesn't create the stuff being pumped.
It works like this: thrust a magnet into a copper ring, and the ring of electrons (the copper's sea-of-charge) will turn in a circle. The motion is current, measured in amps. Cut the ring and insert a resistor. When you move the magnet, the resistor gets hot, because the moving charge is basically "rubbing upon" the interior of the resistor, creating a sort of electrodynamic-frictional heating effect. And, we can heat up any metal by holding the metal still, then moving the metal's electrons. (They move best when forced into a circular flow, like water moving inside an aquarium.)
Or, maybe your question really was this: "How can an electric generator convert physical work into some joules of low-frequency electromagnetic field-energy?" Hook your AC dynamo to a large antenna. Crank the shaft, and the joules of 60Hz energy will exit the dynamo, propagate along both wires, and then fly off into space. (Or, perhaps you prefer to swap out the antenna with a resistive load, such as an incandescent bulb or a heating element?)
See, it's not that hard to understand "electricity." But first you have to confront the fact that ...no such stuff exists. Once you get over that hump, the main barriers are gone, and everything starts falling into place.
One final note: take two bar-magnets and a wide copper loop. (Your loop can be miles across.) Squeeze the loop so it forms a long 'racetrack' shape, with two parallel wires in the middle. Move one magnet past one end of the loop, while holding the other magnet near the far end. The other magnet will jerk! The magnets are somehow coupled together. Wiggling one will wiggle the other. One magnet is the generator, the other magnet is the motor. Make your wire loop 20KM long. Still works! That's the basis of the power grid.
The energy is transferred between the magnets via EM waves guided by the wire loop: when you wiggle one magnet, it produces a charge-flow inside the wire, but also produces a charge-imbalance in the two halves of the loop (the two parallel wires.) An EM wave then flies along the two wires, a wave of e-field and b-field (created by the voltage across the wires and the currents inside them.) When the wave crashes into the far end, its energy is absorbed by the magnet, and the magnet jerks. Physical work was transferred almost instantly from the first magnet to the second, as if they were connected by a moving drive-belt hidden inside the wire loop. A drive-belt does exist. It's the movable electron-sea of the metal wires. A magnet can pump it and make it flow. But when it flows, it can produce forces which move another magnet. (If the copper-electrons are like a fluid, then the magnets are like weird canoe-paddles which can pump the copper's fluid into motion.)