I'm not sure what the "T" over the reaction arrow means....
I can see the reaction going in acid.
Protonate the C-N double bond on N. This generates carbocation on carbon of C double bond,
Carbocation rearranges. The most stable carbocation has cation adjacent to O. 5 membered ring bond to carbon with hydroxyl breaks and shifts over to the cation C (formerly part of C-N bond). This new carbocation has the 6 membered ring and the + charge where the OH attaches.
The OH loses H as H+ and the C=O bond forms.