There is a common over the counter mix of guaifenesin (expectorant?) and dextromorphan (cough suppressant?) that I find helpful. I believe it's called Mucinex DM, but I always get the generic. The one reduces the urge to cough, the other makes coughing more, shall we say, productive. Both drugs are weak enough that I don't notice any side effects at all. In fact the benefits may be entirely psychosomatic. Good enough for me!
Coughing can definitely be psychosomatically induced, but I've never heard of anyone that can produce phlegm mentally. That's typically produce by infection. The condition sounds congenital but OP did not provide enough information to make that assumption.
I've seen similar to this in friends and others all my life but never understood it. In those case, it had nothing to do with activity, and occurred at all different times and under different conditions. I always thought it was a genetic condition.
Growing up my eldest sister had post-nasal drip and I remember her going through this daily ritual of throaty sound-effects -- especially in the morning. She was the only one in the family that had this.