Well... obviously you need a sensor with an electrical output that depends on the magnetic field. I think
@berkeman mentioned the two easy ones, a Hall element or a coil of wire.
A Hall sensor puts out a millivolt-range of voltage directly proportional to the magnetic field it is in. If you want a 3-axis measurement you need 3 Hall sensors, one for each axis.
A coil of wire, or solenoid, will generate a voltage depending on the
rate of change of a magnetic field. This means a bit more processing to get the intensity of the field.
The following approaches are used in digital clamp-on Ammeters that will read DC current flow. The common existing ones on the market are probably too large for your usage, but here is how they operate. Maybe you can modify one to fit your needs.
A alternate way of using a coil of wire is to insert a core of magnetic material and drive an AC current thru the coil. As the core reaches magnetic saturation from the external field, the waveform of the AC current will become non-symmetrical. This non-symmetry can also be used to detect the polarity of the external field.
There are two common ways to sense the distortion of the coil current:
1) If you put a resistor in series with the coil, the voltage drop across the resistor will reflect the coil current.
2) If you put a second winding on the coil (a "sense winding"), the voltage induced in it will reflect the changes in the coil drive current.
In either case, you then subtract this sense voltage from the drive voltage to determine how far into saturation the core is driven. Advantages are that the sense circuitry can be isolated from the coil drive circuitry, and that additional gain can be achieved by increasing the number of turns on the sense winding.
That should give you enough options to keep you researching for a while!
Cheers,
Tom