TMR2ON is #defined elsewhere (likely in some .h file provided by Microchip), and hopefully equals to 2. This means, the compiler preprocessor replaces TMR2ON with 2.
(1<<2) means that value 1 is shifted left by two places:
0000 0001
->
0000 0010
->
0000 0100