How to return a agents model hidden layer output to environment

I am using PPO trainer with a custom hierarchical multi-agent environment, I want to pass the parent agent’s model’s hidden layer output as an observation to the child agent’s model. How can return a hidden layer output of the agents model to the environment?