I have a similar thing at my house. It's not water pipe related, but more of where there is a loose connection somewhere in the framing of the house, and as it goes through the daily heating/cooling cycle, something settles and creates a loud "thud"
In your case, I would start by doing just what you are doing, locating loose fittings, experimenting with turning water off. Also maybe shooting some small amounts of foam insulation around various pipes to reduce the chance of a pipe vibrating against something as the water pressure changes due to whatever is causing the pressure change.
Also- check your bathroom-