With me having about eight years small engines mechanics under my belt as a rental mechanic this is a very common problem with most all makes and models of Generators. It also happens to many other types of small equipment such as plate tampers, Pumps, Trash pumps even some ride on mowers have those on the sides of the block and the same thing happens at times to them also.
From what I have seen over the years it is all in due to corrosion or from the engine heating and cooling the small circuitry. If you were wanting to find it on the engine they are usually more towards the bottom of the block and are usually round with two wires coming out of them.
If you go to this link here: http://outdoorpowerinfo.com/repairs/images/low_oil_shutdown/honda_oil_alert/2_wire_float_switch.JPG
That is on a Honda Generator. Most all low oil shut down switches I have seen look very much the same hope this helps some of you.