Hi , one easy way it can be done is by making a simple Class wrapper to :

extract embeded output
process with what you want
send it back to the body part of the architecture

I have a Kaggle-Tensorflow example (a bit older version) that applying exact same idea -->
making XLM-GPT2 by using embedding output from XLM-R and send it to GPT-2
so that the new GPT2 can handle multi-language (need finetuning in this case)
https://www.kaggle.com/ratthachat/jigsaw-gpt2-with-xlm-r-embedding 77