How can I attach new connections to this old galvanized pipe?
Keep the unions.

If (as seems unlikely, given the over-all condition, despite one differing opinion) you can't get the pipe out of the old union-half, go purchase two new half-unions (or complete unions if you can't source the correct half-unions alone - take the half-union you remove with you to the store to match it) and connect your flex-hose to the half-union. Otherwise just unscrew the pipe from the half-union and screw in the new flex hose, or any adapters you need to connect to the flex-hose.