How do you modify/edit the structure of a HF model

I’m relatively new to HF. I want to import an HF model class (in this case, the MBartForConditionalGeneration class), and customize its structure, e.g., adding some layers or modules to the middle of the model. I think this cannot be realized by simply modifying the Config class.
Does it mean the only way I can do this is to edit the source code of MBartForConditionalGeneration or write one from scratch by myself? Or is there any more elegant way I can do this utilizing HF?
Thanks for any insight in advance.