Magnetic field models, such as IGRF2000, often provide the output as a vector in a World Reference Frame, ENU (East, North, Up) or NED (North, East, Down). The components X, Y and Z from the question correspond to NED (X -> N, Y -> E, Z -> D).
If you have a position vector $\vec{p}$ of the location where the magnetic field vector is taken in some reference frame $F$, you can find a rotation matrix that will convert your magnetic field vector to that frame $F$. If you have the position vector in ECEF, just follow the procedure explained below. In case the vector is in ECI, either convert it to ECEF first or you can convert the resulting magnetic field vector in ECI to ECEF. Some hints on how to do this conversion can be found here: Transform ECI to ECEF
NED to $F$ conversion
I apologize for quite bad axes alignment job on the picture, it was my first time using Blender. On the picture there is a big coordinate system, representing the $F$ reference frame, located at the center of a sphere representing Earth. Red axis is $\hat{x}$, blue is $\hat{y}$ and green is $\hat{z}$. Small coordinate system is the NED reference frame, with the red axis being North $\hat{n}$, blue is East $\hat{e}$ and green is Down $\hat{d}$. The yellow line is a vector $\vec{p}$ going from the Earth center to the location of the magnetic field vector measurement.
Two things should be noticed from the picture. First is that the vector $\vec{p}$ and $\hat{d}$ are coincident. Second is that $\vec{z}$, $\hat{d}$ and $\hat{n}$ are always in the same plane. For the NED, $\hat{n}$ is always pointing straight to the Earth's north, where the $\hat{z}$ is located, $\hat{d}$ straight to the Earth's center, while the $\hat{e}$ is only generally in the East direction, completing the orthogonal right handed axes triad.
The goal is to find all three axes of the NED frame in the $F$ frame.
Vector $\hat{d}$ can be obtained by unitizing $\vec{p}$ and negating it.
Vector $\hat{e}$ is normal to the plane within which lie $\hat{n}$, $\hat{d}$ and $\hat{z}$. Cross product of any of the two vectors from this plane will produce $\hat{e}$. We calculated $\hat{d}$ already and we know $\hat{z} = [0 \; 0 \; 1]^T$.
- $\hat{e} = \hat{d} \times \hat{z}$
Finally, $\hat{n}$ vector is normal to both $\hat{d}$ and $\hat{e}$, thus:
- $\hat{n} = \hat{e} \times \hat{d}$
The final rotation matrix can be obtained by taking transpose of the matrix constructed with these three vectors:
- $R = [\hat{n} \; \hat{e} \; \hat{d}]^T$