Grip the 'flats' on the ball-joint body to hold it in exactly the same position while you loosen the locknut with a spanner.
Track-rod-end ball joints are not adjustable on later cars. If they wear, you must replace them....