Emergence of electron coherence and two-color all-optical switching in MoS2 based on spatial self-phase modulation