Processes arising in the edge and diverted plasmas during ITB formation in the U-3M torsatron