Hi,
You need an generator with excitation coil. This generates the rotating magnetic field.
With the current of the excitation coil you influence the magnitude of the magnetic field and thus you influence the magnitude of the output voltage.
In opposite to an asynchronous generator this is a "synchronous generator" which needs a special treatment (frequency synchronisation, phase synchronisation, voltage control) before you switch it to the grid.
When connected to the grid: use the excitation current to control phase angle.
For offgrid solutions you need to continously measure the output voltage and then adjust excitation current to get constant output voltage.
Klaus