I am going to install a ceiling light.
The problem with answering this is we don't know how it is wired.


If the hot enters the switch and leaves as a three-wire that switches the outlet with the red then it is it just a matter of cutting the wire in the attic, installing two junction boxes and reconnecting.  Then feeding out of one of the junction boxes to the new light off the red, white and green.
If the hot enters the outlet first and leaves as a two-wire (switch leg/loop) to the switch, then all you have in the attic is a switched hot with no neutral.  This is not good because the new light requires the switched hot plus a neutral.