Understanding modulated twin transition at the atomic level