If $n = \pm\langle 0, 0, 1\rangle$, then $Z_{P} = 0$ and your point is already in the desired form.
Otherwise, $u_{1} = \langle -\cos(A), \sin(A), 0\rangle$ and $u_{2} = n \times u_{1} = \langle -\sin(\alpha) \sin(A), -\sin(\alpha) \cos(A), \cos(\alpha)\rangle$ are an orthonormal basis for your plane, and
\begin{align*}
x_{P} &= (P - C) \cdot u_{1}
= -(X_{P} - X_{1}) \cos(A) + (Y_{P} - Y_{1}) \sin(A), \\
y_{P} &= (P - C) \cdot u_{2}
= -(X_{P} - X_{1})\sin(\alpha) \sin(A) - (Y_{P} - Y_{1})\sin(\alpha) \cos(A) + (Z_{P} - Z_{1})\cos(\alpha).
\end{align*}
I will assume that your local coordinate system corresponds to your global coordinate system when yaw, pitch and roll are zero. By that I mean that x = forward, y = right, z = down (SAE standard). I will also assume that yaw, pitch and roll are done with respect to local axes in that order in the right hand sense. By this I mean that first you yaw about Z (CW), then pitch about Y (Up) and then roll about X (right). You can then define a quaternion for each of these. Let $\psi = $ yaw angle, $\phi = $ =pitch angle, and $\theta =$ roll angle. Then:
$$q_y = [\cos(\psi/2), (0,0,1)\sin(\psi/2)]$$
$$q_p = [\cos(\phi/2), (0,1,0)\sin(\phi/2)]$$
$$q_r = [\cos(\theta/2), (1,0,0)\sin(\theta/2)]$$
Then your composed rotation would be
$$q = q_y q_p q_r$$
in that order. You can then rotate a vector $a = [a_x, a_y, a_z]$ from the global (NED) to local frame (SAE) by using the inverse transformation
$$\bar{a} = q^*aq$$
using normal multiplication rules for quaternions. You can also work out a normal rotation matrix from $q$ if that is what you prefer. The equation is found in many places on the web like here.
I gave you just the highlights assuming that you have some familiarity with the algebra of quaternions.
Best Answer
I'm actually not convinced the linked question is answered correctly, but in any case I think it's simpler to answer this question from first principles rather than try to adapt another question's answer.
To summarize NED coordinates, the first coordinate axis points due north (N), the second points due east (E), and the third points straight down (D). I will label these axes $x$, $y$, and $z$, respectively, as shown in your figure.
Start with a unit vector pointing due north, which is in the direction of the $x$-axis: $$ \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}. $$ For elevation by an angle $\theta$ (oriented so that positive elevation produces a negative $z$ component), we rotate this vector to the position $$ \begin{pmatrix} \cos\theta \\ 0 \\ -\sin\theta \end{pmatrix}. $$ For azimuth angle $\psi$, we rotate the vector around the $z$ axis through the angle $\psi$ in the direction of rotation from the $x$ axis toward the $y$ axis. Viewing the vector componentwise, the $z$ component is unchanged but the $x$ component is rotated in the $x,y$ plane so that the vector becomes $$ \begin{pmatrix} \cos\theta \cos\psi \\ \cos\theta \sin\psi \\ -\sin\theta \end{pmatrix}. $$