The heating curve you've shown is assuming that heat energy is being slowly added to the substance over time1. So that time axis is really an energy axis.
In the diagonal parts of that chart, as we add more heat energy to the substance (and wait for it to distribute evenly throughout) its average temperature gradually increases, directly in proportion to the amount of heat we're adding. But things change once we reach a phase change temperature.
Breaking molecular bonds to transition from a solid to a liquid or a liquid to a gas takes energy. So every bit of solid that melts to a liquid "steals" a bit of the heat energy that is being added to the system. It doesn't really matter whether you think of the energy as breaking bonds "instead of" raising temperature, or think of it as raising the temperature of a bit of the solid above its melting point and then its bonds break and cool it back down. Either way, the average temperature of the substance stops going up at the same rate as it was before - that alone is enough to see that the line on the chart can't continue at exactly the same rate once it hits a phase change temperature.
The total amount of energy needed to melt/vaporise all of the substance is a non-negligible finite quantity. We're adding heat energy gradually and slowly, so to build up that total quantity of energy is going to take some time. That means we're not going to transition the entire bulk of the substance from solid to liquid (or liquid to gas) all at once. It's a gradual process that takes some time. During that time we're adding more energy but the substance is also "spending" energy to change phase, so there are two processes changing its average temperature; one positive and one negative. And if we add heat faster it simply means there is more excess energy available to break bonds faster, so the rate of conversion increases to match. This ends up meaning the average temperature stays pretty much constant - instead of the temperature changing in proportion to the energy being added the rate of phase change is in proportion to the energy being added. (But the rate of phase change isn't something directly represented in this chart, so it looks like "nothing is happening").
Finally, once the substance has fully transitioned, adding more heat raises the temperature again as the substance can't "steal" this energy to break bonds instead; all the bonds thermal energy is expected to break at this temperature are already broken.
Also note that the phase change is a continuous process, and that's important to explain the flat areas of the chart. On the scale of individual molecules, bond breaking is not continuous; either there are bonds or there aren't, there are no partially broken bonds. But the sort of model behind the chart is not used for individual molecules, it's used for relatively large bulk masses. And a bulk mass does change phase gradually as it gains/loses heat energy; not in the sense that it can be in a state that is "in between one phase and another", but in the sense that the fraction of it that has transitioned gradually increases from 0% to 100%.
You've probably seen an ice cube melt; the ice cube gradually gets smaller and smaller as the bulk gradually transitions to water. It doesn't suddenly liquefy all at once! And this is why there's a flat area on the chart; the energy needed to melt the ice is "spent" continuously over a period of time, and over that time the average temperature isn't increasing so the chart of temperature vs time/energy is flat. If the phase change were not a continuous process the substance would instead "save up" the energy we're slowly adding in the form of temperature until there was enough excess energy to transition the whole bulk. If that were the case you wouldn't see these plateaus in the chart, you'd instead see the temperature continuing to increase and then a vertical jump down as it lost temperature by putting some of its internal heat energy into breaking bonds. So this chart actually is evidence that "breaking bonds" is a continuous process (on a macroscopic scale).
--
1 It's important that this is a slow process, meaning the rate we're adding heat is low relative to the rate at which heat can distribute throughout the substance. That lets us model the substance reasonably accurately as a single "thing" with one average temperature.
Things get more complicated if the heat is not evenly distributed throughout the substance (we have to model the various parts of it at different temperatures interacting), or if we're talking about very small scale (we need to model individual molecules and transitions).