L298N heating because of engine problem. Yes but why?

Hello,
I control two engine with a L298 N (powered by 12 volt 1) that can deliver up to 2A (by engine I think) peak and 20W continuous and 25 W max. I put the datassheet as an attachment.

I control my first motor with a PID algorithm thanks to an integrated encoder so that the motor runs at a constant speed.
Here is its characteristic Motor operating voltage: 3 ~ 7.5V (Rated voltage 6V).
The other engine runs at the same speed as my first engine.

When I block the 1st motor with the PID, the program increases the output voltage so that the motor catches up with its speed.
But what if I block the engine for a long time?
I imagine that the L298N also increases the current, and it heats up. But can current and / or voltage damage the motor?
I put the engine datasheet as an attachment

Because now my engine with the encoder is not running at the same speed, see stops as l298N heats. Have I burned the engine by sending too much current? (It's weird because it's still running but not fast)

Fortunately, I have exactly the same engine and the L298N no longer heats, and the engine runs faster.

But how can I preserve my engine in the future?How can I limit the intensity? or is it a problem of tension?

Thank you for your answers. (The goal is that I can block and even reverse the direction of my engine as long as I want).

PS:
the first PJ is the engine
the second the L298N

The ancient, very inefficient L298 cannot be used with that motor, as it cannot handle the nominal 2.8 A stall current. 5.6 Amperes at 12V!

You need a modern, much more efficient motor driver, like the following from Pololu.

Powering a 6V motor with 12V should have been a clue here...

so I power the L298N with 6 Volt, I'm sure to not burn my motor?

The L298N will not work with 6V, or with that motor.

The L298N has about 2V drop. So to get 6V out you have to put 8V in.

Still it won't handle your motor's stall current.

Thanks for all yours answers.
I reformulate my question: How can I be sure to not burn my motor if I block it?

Even I give 6 or 8 volt, I will have the same problem, no?

To avoid destroying a motor during a stall, use a modern motor driver with a current sense output. If the current goes above a limit you set, turn off the driver.

I suggest this one for your project: Pololu - TB9051FTG Single Brushed DC Motor Driver Carrier

The OCM output produces approximately 500 mV per Ampere of motor current, but you will need to calibrate it to be sure.

Keep in mind that a brushed D.C. motor momentarily draws the stall current when it starts up, and if it is rapidly reversed, can draw twice the stall current.

Using the L298N should ensure your motor doesn't burn as the L298N is likely to burn first... especially if you provide it with enough current.