How should I go about replacing a cracked sanitary tee in a sink drain?
You've got it! Make sure that you

use matching black ABS pipe, not white PVC
get glue appropriate for ABS, not PVC
make sure you clean off the drain pipe so the glue will adhere properly
since you've got a fair bit of room to work, cut your straight pipes far enough back that you can easily work with them

do not try cut right at the edge of the T, your life will be miserable.
I'd suggest cutting the drain just enough up from the sole plate that you can slip the coupler on with a bit of room to spare.
Cut the horizontal about mid-way between the studs
Cut the vent high enough that you've got room to work, but not too close to the extra stud - it might interfere with getting the coupling on.



You might need to use a flexible coupling to get the T reinstalled since you've got to get all 3 in at the same time. OTOH, there may be enough flexibility in the vent stack that you can wiggle it together without one - you may have to play with it as you're dry fitting everything to find out.