Hello xt world

can someone tell me wich reason could be for shutting down engine in the middle of drive ...its similar to shutting off bike on emergency red button.I thinking about that ... maybe somewhere electricity escapes or maybe is something with lock (bad contact) also can be something wrong with emergency button... am i on right way ? In 2000 km this happend to my xtx 3 times ... it's not good feeling ... please someone help me ... because im not expert and i want hear some opinion from you guys. Sry about my eng
Cheers