Since the end of the gear with the threads are gone, you're going to have to weld something the the stub, a nut, bolt or threaded rod, to use to pull it out.
Looking at the picture, both bearings (#20) are in the bore, and since they probably fit with very little clearance to the bore, it may take considerable force to pull the assembly out.
Good luck.