The three-dimensional transition to turbulence in the transonic flow around a NACA0012 wing of constant spanwise section has been analysed at zero incidence and within the Reynolds number range [3000, 10000], by performing the direct numerical simulation. The successive stages of the 2D and 3D transition beyond the first bifurcation have been identified. A 2D study has been carried out near the threshold concerning the appearance of the first bifurcation that is the von-Karman instability. The critical Mach number associated with this flow transition has been evaluated. Three other successive stages have been detected as the Mach number further increases in the range [0.3, 0.99]. Concerning the 3D transition of this nominally 2D flow configuration, the amplification of the secondary instability has been studied within the Reynolds number range of [3000, 5000]. The formation of counter-rotating longitudinal vorticity cells and the consequent appearance of a large-scale spanwise wavelength have been obtained downstream of the trailing-edge shock. A vortex dislocation pattern is developed as a consequence of the shock-vortex interaction near the trailing edge. The subcritical nature of the present 3D transition to turbulence has been proven by means of the DNS amplification signals and the Landau global oscillator model.