If I switch on a generator connected to an open circuit, are the charges oscillating along wires? Where has the energy gone in the open circuit?
What "the charges"? You haven't shown any charges to exist.
Assuming a normal "generator", it will be mostly a voltage source. "Open circuit" means nothing is connected, which is another way of saying that the impedance presented to the generator is infinite. If the generator is producing AC voltage, then the voltage oscillates. However, since the impedance is infinite, there are no charges moving as a result of that voltage (the current is 0).
In reality, there is never such a thing as a open circuit (true infinite impedance). There will always be some small but finite capacitance and leakage resistance between the open leads of the generator. A small amount of charge will flow thru the generator leads thru this impedance, but will be too tiny to be relevant in any practical sense.
Where the energy goes is the wrong question, since it assumes there is energy somehow hanging around in the first place. If the generator output is left open, it produces no power. With ideal and perfect mechanical parts, it would take no torque to turn its shaft. In reality, there will be some friction, eddy currents in the wires going thru the magnetic fields, and other losses. It will therefore take some torque to turn the generator shaft, even though no electrical power is coming out. This torque times the shaft speed is power into the generator, which will only go into heating parts of the generator.
If it is an AC generator,yes the charges will oscillate.