It doesn’t, at least not directly.  Since stability is an assessment of the proximity of the gain vector to the singular unstable point, (1,0) on the  complex plane, we can assess it, via Q, as 1/(1-T) (or 1+T depending on where we account for the negative feedback).  This means that there is no such thing as “gain margin” or “phase margin”, but stability margin as a measure of the proximity of the vector gain, T to (1,0).

We can equate the stability to an equivalent phase margin by assuming the magnitude of the gain vector to be 1 and solving for the Q.

In our simple example below, the measured Q from the output impedance is 5.77 and we can equate that with 1/(1-T).