If I get in a project and the hub isn't shifting right, I'll spray a bunch of WD40 in it and take it for a short ride. Usually its shifting within a couple of blocks. Then I put it on the stand, rotate the oil port down, and spray more in while catching what comes out so it doesn't make a mess. Once its done draining I use automatic transmission fluid as a lubricant and take another ride- about ten miles or so. Then I change out the oil and again and use a bit of light gear lube like I use for the Rohloff.
WD40 is a tool and not a lubricant. I prefer to use Kroil if I have a stuck bolt, seatpost or stem, but it smells terrible so I have to use it outside and make sure everything is cleaned of it before bringing the parts back inside. But for freeing stuff that's stuck its the best I've encountered.