Edit: Nevermind, training units creates a ping too. I was going to suggest using Units as Upgrades but that won't work.
I tried a few things but couldn't find a nice solution. You could always Research your upgrades using triggers and abilities.
"A unit starts the effect of an ability -> Ability being cast = Animal War Training -> Wait 30.00 seconds then Set Research level of Animal War Training to 1".
You can base the ability off of Charged Gold and Lumber to mimic the Gold/Lumber cost. The only problem is if you wanted to cancel the Research you would have to figure out some way of doing that.