An Idea
I know of no other way than cutting at least one of the pipes near the threaded coupling. Without seeing it, here is my best guess. Turn off and drain the system. Cut the pipe emerging from the lateral (sprayer) side of the valve. Now you can carefully unscrew the old valve and cut off coupling, leaving the treaded coupling on the main line intact. Screw in a replacement valve, with a new threaded coupling already attached to the new valve on the down stream side. If you can not free up enough flexibility in the old pipe to insert it using a coupling, obtain a slip-fix, and follow the instructions, or if space allows, attach new treaded coupler to old pipe using 2 to 4 els. If your valve is in line on the main (a master valve, and pressurized on both sides, Using el's is probably the best method. I do not use slip fixes on pressurized lines, only downstream of the valve. Again, as space allows, you can cut both sides to the threaded couplings, clean the pipe, and insert a new valve with treaded couplings on bot sides. Glye the upstream on to the mainline, and fabricate the downstream connection. Always use teflon tape on threads- 4 to 5 turns
Hope that helps, if not write back. Jeff