You can think of M6 as a lousy integrator while the circuit is slewing. The current from the first stage will go through the compensation cap. Of course, Vgs of M6 will change a bit but approximately we can consider it as constant with respect to the much bigger variation of the output (drain) of M6. So, the rate of change in the output will be defined by the change of voltage across the cap as it has been charged by a constant current. Once the output reaches Vdd, of course everything breaks. Vout can't go up any further but the capacitor still has current and now there is no other way but gate of M6 to start decreasing until the transistor is off.