Probably you would have to change the code a bit and skip the creation of the nn.Sequential modules (line of code 2).
Do you need x for the training, i.e. are you feeding it to another layer, or is it just for debugging purposes?
If the latter is true, you could use hooks 7 to get the activation.