When you shut down the generator the temperature shoots up because there is no more air circulation and you have a lot of heat in the engine. This stands true in any internal combustion engine.
What I do is I leave the generator running for 5-10 minutes with no load before shutting down so it can cool down and then I shut it down.
If your generator has poor air cisculation, you need to let it cool down with no load while running. I had a 5500 that the previous owner told me to be carefull because he had that problem. Because I was doing this I never had an issue restarting it.