You can check the transform.eulerangles value in the LateUpdate() function.
Lets say your character did a flip if it reaches the 350-360 interval. Then you increment your flip value and set a boolean variable to dont increment until it does not leave this interval. After its left you can check again.

This is the first idea that came into my mind maybe there are more elegant ways to check but its not trivial because of the repeation of the 0-360 values.

In many situations, eulerAngles does not give back what you want. There are multiple eulerAngle representations for any rotation, and sometimes Unity changes the representation. For 2D, you can use ATan2(). Assuming you are rotating counterclockwise, you can do something like this:

Note that Mathf.Atan2() returns angles in -180 to 180. The sign will flip when it goes form -180 to 180, so you cannot just check the sign. That is way the ‘prevAngle > -10.0f’ is included. ‘prevAngle’ is a class instance variable. Atan2 returns 0.0 for Vector3.right. So when the ‘transform.right’ is equal to ‘Vector3.right’ the angle will be 0.0.

This shows me how many degrees my character rotates even if it’s more than 360°.
Then I just have to divide it by 360 to know how many flips it has done.

Example :
Player rotates -720° → -720/360 = -2 (Which means 2 backflips)
Player rotates +720° → 720/360 = 2 (Which means 2 frontflips)

It seems to work right now, but do you guys think this is the proper way to count flips ?