5740 is a big fella, and I don't know specifics of it, but that's going to depend on what "out of it" means. It's likely similar to most other such things in that there will be several splined couplers along a shaft driving the front axle pinion. Seems like those splines are often the problem, and if so that might be something you could do yourself. But at each end those splines are on shafts (axle pinion and transfer output) that are quite a job to replace, particularly on something that size. And given that you ask the question, it's likely a safe bet that anything inside the front axle is going to be a "take it to be repaired". Not knowing that tractor, it could also be an actuator issue of some sort. If you do work yourself, there are workshop manuals available, and that's where specifics are found.
Hopefully someone with more specific knowledge will be along before long.