Get output of intermediate layer of pre-trained model

Forward hooks are the right approach as described here.