So, you have inspected the impeller? No missing vanes?
There are a couple of spots where the outdrive plumbing can leak air in while water is being drawn up to the raw water pump and it loses suction.
The inlet hose fitting on the intermediate drive can be corroded away, and air can enter there and the raw water pump loses suction. It might even look like the hose connection is good with clamp intact, but that fitting has begin it's passage into the afterlife, starts at the end of the fitting and eventually gets to the beginning of the hose end. In the water while idling or just putting around all of that is underwater and will not cause an overheat. On plane the raw water ump starts losing suction, and the engine will not get enough cooling water and eventually overheats.
This suction leak will happen on the trailer if that fitting is compromised. First, on the trailer, be sure to plug the drain hole on the bottom of the drive, and use proper fitting flusher attachment. (Maybe you do all this already) If it will not draw water up to the raw water pump with good hose pressure this fitting may be the problem.
As a trouble shooting method for the pump operation, Volvo Penta recommends that a clear hose be installed in place of the long hose that runs from the transom inside the boat up to the raw water pump, and look for solid water stream (good) or bubbles (not so good).
I changed one out on good advice from here, several years ago, while doing the bellows on a prior boat. I also put in a new hose, pokes in from the inside of the transom. When I removed the hose from the fitting on the outdrive I was very surprised. The fitting had corroded so much that a third of the metal around the end of the nipple was gone, and a vee shaped path had worked its' way up to where the end of the hose was. Pretty sure it had begun a small vacuum/suction leak. I used to have it on display in the Knick-Knack section of my Hall of Shame, wish I had kept a pic or two, it was absolutely classic.