North, South, East, and West are Earth related directions that are determined by the planet's magnetic field, but with no planet in space to guide them, how can scientists figure out directions beyond Earth's atmosphere? To answer this question, it's important to realize that directions are completely arbitrary human inventions that hold no real scientific significance. In short, directions exist solely to make our lives easier when navigating through the space in which we all live. You could reverse the definitions of all our directional terms tomorrow (so North means South and vice versa) and, with the exception of a few very confused people, we'd have no adverse affects--there would be no changes to how science operates.
However, to answer the real question, the method we use for finding directions in space (yes, we do have Northern and Southern Hemispheres for the universe /galaxy/solar system) is related to the directions we have on Earth. So, how did these directions come about?
The Roots of Modern Directions
For the purposes of this section, I'm not going to concern myself with where the name North, South, East, and West came from (and it's different translations in various languages around the world). Instead, I'm going to talk directly about the concept of direction relative to the way we think about it today.
Throughout history, humanity has known a countless number of map orientations. Most of them were egocentrically centered (or "ethnocentric"). This essentially means that, in each culture, the most important feature was placed in the most important part of the map. An example can be seen in the old Edo maps from Japan that placed the Imperial Palace at both the top and center of the map. On the map itself, the Imperial Palace was the center, but you had to lift the map over your head (making it the "top") to read it correctly. Many Medieval European maps placed the East (particularly Jerusalem) at the top of the map due to its religious significance. In addition, some cultures placed East on top because that's the direction the sun rose from. Maps created in cities on the sea often have the sea placed on the top of the map for reasons I haven't been able to uncover (probably because of some link to trade and sustainability).
The prevalence of the "North biased" top seems to have its roots in two aspects of European life. The widespread use of the compass between the 11th and 14th centuries is, in my opinion, the greatest contributor to the European Northern directional bias . Magnetic North pointed travelers Northwardly, so maps adjusted accordingly bu placing North at the top. In addition, in the Northern Hemisphere, the sky seems to rotate around Polaris (the North Star), so this aided in the change. Finally, cartographers were placing the British Empire (Europe) on the top of the map to help demonstrate Britain's power over the world (this is that egocentric/ethnocentric idea). The spread of the British Empire ultimately forced a change in the way the world oriented itself.
Random fun fact: the map term "to orient" is a throw back from the East-on-top bias from Medieval Europe where the Orient was on top.
This North on top bias was ultimately "chosen" by humanity as the way our maps were to be drawn, and this method hasn't really been seriously challenged since it was established. When we began modeling our solar system, we divided the system along the sun's equatorial axis and called everything that Earth's Northern Hemisphere pointed to the "Northern Hemisphere" for the solar system (this also defined the Northern Hemispheres for most of the planets/Sun/major moons/dwarf planets, etc. in the solar system), and we did the same thing with the Southern Hemisphere. In the same way, this reasoning was used to further define the hemispheres of the galaxy, the universe, and pretty much anything else we want to assign hemispheres to. It's all related to what European cartographers decided to do in late Medieval era.
Navigating the Solar System
Now that we have defined the directions in space, how do we use them? When a spacecraft is far away and Earth is nothing more than a dot in the distance, the probe can't look back at us to orient itself. There must be another way.
Probes use a few different tools to find their way in the vast vacuum of space. All (unmanned) interplanetary vehicles are controlled from Earth, so all of the below functions take place in the terrestrial ground stations in charge of the mission.
First, scientists need to know where the craft is and how fast it's going. This is where the Deep Space Network (DSN) comes in. This is a network of three radio antennae positioned around the world so, between them, they have full coverage of the sky. Signals received and sent by the probe are measured for very slight shifts in frequency. By analyzing these shifts, and the length of time between transmission and reception, scientists are able to calculate the probe's position and velocity with stunning accuracy. In fact, we can measure the probes line-of-sight velocity to within 0.05 millimeters per second and its location to within three meters. That's way more accurate than the speedometer on your car and your GPS (depending on which GPS you're using). And keep in mind that we are talking about probes that are often thousands, millions, or billions of kilometers away.
Second, we need an accurate model of the solar system to work with. One of the biggest assets to our probes are the planets. We use gravity assisted maneuvers all of the time. A gravity assisted maneuver is when we use the gravity well generated by a body (usually planets or large moons) to alter a spacecraft's trajectory and speed. Plus, all of our current deep space missions are interplanetary, meaning they are going to some destination inside the solar system (usually a planet or other object). If we don't know where our targets are, we can't send a probe to it to study.
Third, we need is an accurate understanding of orbital dynamics. This allows us to plan missions (since it can take probes many years to reach their destinations, these missions are often planned far in advance to take advantage of planetary alignments), this allows us to make alterations to a probe's trajectory as it journeys to its destination.
In general, all of our probes orient themselves in relation to the solar system, but what happens when the time comes that our solar system becomes a mere dot off in the blackness of space? We'll still need to know the location and velocity of our spacecraft.
In such instances, we will likely use something similar to the DNS (Voyager 2, humanity's only interstellar spacecraft to date, uses the DNS so that scientists know where it is and how fast it's going). We'll also need an accurate model of the solar system (to assist in a spacecraft's departure), but we'll also need an accurate model of the motions of the stars we are going to, as well as an accurate model (or the ability to make one very quickly) of the target solar system. Both of these are possible (and are done) with today's technology, so we wouldn't really need any new developments in these technologies. After this, our model for orbital dynamics carries over to whatever solar systems we might find ourselves in. As far as we can tell, the laws of physics are universal - they certainly hold true on these "small" scales.
Finally, we'll need to create accurate star maps. We have a very accurate model for the sky as it appears from Earth/our Solar System. We can estimate how the sky looks from different angles and perspectives, but this also requires a very precise map of where the stars actually are (we have a good idea of the locations of the stars in the Milky Way, especially the one's close to us, but often they have uncertainties that are unacceptable for navigation). Our first interstellar missions will likely be tasked with analyzing the sky and building these star charts.
All of our directions are currently Earth biased, having their roots in the cartography of Imperial Britain. The generic North, South, East, West directions will likely not change, but they will be enhanced and made more accurate by our use of degrees. We'll continue to use DNS type systems to function as a GPS system for the solar system and the stars will, once again, serve as our navigational markers when we start going beyond the reach of our Solar System. In the end, the accuracy of our maps and models are what allow our spacecrafts, past present, and future, to find their target destinations across the vast emptiness of space.