Synchronising a generator for connection to a network or to another generator with automatic parallel connection when synchronisation is achieved