Exercising increases testosterone. The simulation of the fight or flight response and the breaking of muscle fibers makes the body generate more T.
The jerking off increase is temporary, and, in the long run, may even reduce T as the body gets more peaks and valleys of testosterone prescence.