In general, you use a gain-phase analyzer.
Insert a small resistor (22~100Ω) in series with the top resistor in the output divider. Using a transformer, inject the signal from the analyzer right across the small resistor. Adjust the level to get only about 50~100mVpp of signal in the DC output.
Connect the test channel of the anlyzer to the output of the power supply (top end of the small resistor you inserted) and the reference channel to the lower end of the small resistor. Take the measurement and display the Test/Ref in dB and the phase in degrees. Sweep from about 10Hz to no more than half the switching frequency. This is the open-loop Bode plot of your power supply.
Where the gain is 0dB you found your crossover frequency. Measure the phase at this point and make sure the margin is adequate. Then measure the gain when the phase its 0 deg . Make sure there is enough gain margin.
Typical phase margin values are in the 45~60 deg, although DCM flybacks can easily get to 90 deg. Anything below 45 is suspect. Make sure to use the maximum additional output capacitance, if any.
As for the gain margin, it should be at least -7dB, but -12dB is better. Generally, this is not a problem.
Noise can affect your measurements, so you may need to adjust the analyzer's output level, but keep it as low as possible (you are doing a small-signal analysis, after all). To reduce the displayed noise, use the averaging function on the analyzer.