2013 foreman 500 ps

Went trail riding at elkhorn lake in Java va (awesome place ) and about 2 hours into ride my Ps stopped working I rode it about another hour like that and then stopped and let cool went back out and it 15 min and it stopped working again the trails are moderately difficult I rode the rest of day wo Ps anybody else with this problem