either by using a shaft coupling or by taking the gearbox to bits, smacking the output shaft out of the plate with the three gears in it and then welding the new one in place. You could try welding it straight on but you may have alignment issues.