It sounds like you may be getting air in through the through-hull. I would check to see how well the water
pump is working per Cam's suggestion. If it seems to be okay and generating enough suction, I would see if there's anything obstructing the outboard side of the t-fitting to the exterior of the boat. Maybe you have kelp or something else growing or stuck in that side of the hose. Also, double check all the hoses, just in case.
If the
pump isn't faulty, then there has to be an obstruction, and when you're on a heel, the head* on the through-hull lessens, reducing the water pressure at the through hull. If the flow is restricted enough, this may be causing the engine to suck air from the head side of the t-fitting. BTW, this might have become a problem because the new water
pump is working much better than the old one—since it would demand more water, it would pull on the hose leading to the head more strongly than the old
pump, increasing the likelihood of getting air via that hose. Hence, my argument for leaving the raw water for the engine on a dedicated raw water through-hull.
After trying the water
pump in a bucket, I would try connecting the hose directly to the seacock, and removing the t-fitting. If it doesn't lose prime after that change, you know it is sucking air in via the head hose, and that the through-hull or outboard side is probably obstructed to some degree.
* head is also a term used to describe the amount or height of water at a specific point.