How to get activation maps of models

Hi, I am trying to get the intermediate activation values/maps of GPT2 model and others. I think there is no built-in “hook” function provided by huggingface. Does anyone know how to implement it? Any suggestions are appreciated!