Using an Arduino in series with a 3-axis acceleromter and 3-axis gyroscope.

The method I linked assumes that the accelerometer is stationary, or is not being accelerated by a force other than gravity.

It measures the angles that gravity, or "down", makes with the accelerometer axes, and calculates pitch and roll angles from those angles.

If the mower is traveling at a steady rate in roughly a straight line, and is not being bounced around, the method linked should work well. A gyro would add considerable complications and won't help for this project.