Hello
Hope you are well.
Using a fault will be helpful for this; A fault condition can result in the PWM output being tristated, forced to a logic 1, or forced to a logic 0 depending on the values programmed into the OCTRL[PWMxFS] fields.
This fault condition only disables the output but the timer continues running.
The timer is stopped by writing to MCTRL register, you can do this with the PWM_StopTimer() function.
To do this by the hardware you can connect your external signal to the GPIO so when the GPIO receives that signal, the function can be called.
I suggest you do this by interruptions otherwise the GPIO will be polling consuming CPU resources.
If you have more questions do not hesitate to ask me.
Best regards,
Omar