I don't have any evidence from the book, but my logical assumption is that Hagrid taught himself how to do it.
- We see Hagrid casting non-verbal spells, so clearly he learned how to do it somewhere.
- It's been fifty years since his expulsion, so he's had plenty of time to teach himself.
- Since he's not supposed to do magic, he would want to learn non-verbal spells as they're more discreet (see also: his umbrella wand).
- Since he's not supposed to do magic, he probably can't go around asking people to teach him.
We do see that Hagrid isn't an expert at it, however. Making an oar move on its own, and igniting a fireplace (which Hagrid also does while at the shack), are pretty simple spells. However, when Hagrid tries to do something significantly harder - turning Dudley into a pig - all he can manage to do is give him a tail.
"Shouldn'ta lost me temper," he said ruefully, "but it didn't work anyway. Meant ter turn him into a pig, but I suppose he was so much like a pig anyway there wasn't much left to do."
Harry Potter and the Philosopher's Stone, pg.48 (emphasis mine)
So I believe Hagrid taught himself how to do non-verbal magic, but only up to a certain level.