Cutting across a steep slope on a riding mower can be an exceedingly dangerous proposition. The mower can easily tip over, trapping the rider under the unit or worse, exposing the rider to the spinning blades. For this reason, some lawn mowers will have slope sensors that cut the mower off if a hill is too steep to be mowed safely. This is a safety feature, and should not be tampered with or disabled.
If the slope is not particularly steep, and the lawn mower is cutting off anyway, it may be due to a weight shift in the seat sensor. For good reason, many riding lawn mowers have seat sensors that detect when the rider gets up from the seat, and shuts the unit off to prevent the mower from continuing on its way sans rider. If you are shifting your weight at the point of the slope, the sensor may be detecting the shift and cutting off fuel to the mower.
If you have a traditional push or self-propelled mower that cuts off when you mow a slope, the issue may be with the fuel supply. If the fuel tank is not topped off, the slope may be sloshing the gas to the back of the tank, out of the reach of the lines that feed the engine. When you hit the slope, the gas sloshes back, and the unit cuts off. Top off the tank and see if the issue is resolved.
Lawn mowers are not intended to be used on exceedingly steep inclines or slopes. When a lawn mower is tilted too far back, the oil in its crank case and oil tank may slosh away from the engine and fill up in the intake. This leads to engine malfunction and, if the engine keeps running long enough, engine failure. Ensure the lawn mower you are using is rated for a slope as steep as you are attempting to use it on, and that all fluid levels are topped off.