Mechanisms of strain localization and nucleation of earthquake faulting by grain-scale processes at the middle crustal level