Like the forward hooks you have created, you should create a backward hook like:
global glb_grad_teacher
def Get_grad4teacher(self, ingrad, outgrad):
   global glb_grad_teacher
   glb_grad_teacher = outgrad
   return None
t_emb_layer.register_backward_hook(Get_grad4teacher)

And then after you have done backward(), you can look at glb_grad_teacher to look at the gradient for t_emb_layer for that loss function