Dyadic Green's function formalism for photo-induced forces in tip-sample nanojunctions