Normally, overheating is caused by some sort of leak in the cooling system causing it not to be water-tight. Here is something to consider, although it may not be your problem, I am just offering this because it happened to me once.
I measured the oil level once while the bike was on the kickstand rather than the stand that holds the bike level. (Big mistake) Since the bike was not level, it appeared to me that the oil was low. I added a bunch of oil to get it to show full. In reality, had I checked it with the bike on the level stand, it would have shown that I very much over-filled it with oil.
It would not overheat while idling, but did overheat and boil over when I went out riding, similar to your experience.
So, I am just offering this for what it's worth. If that is not the case, then good luck because I know from working on cars that cooling system leaks are sometimes hard to find!