Add a non-base field to a content entity form
You can ship a locked Field with yml only, see core/modules/forum/config/field.*. Ie just make the fields in the ui and copy the yml files from your active store to a config folder inside your module. 

This ships a locked boolean field for the container flag. You'll also need form and entity display entities, but you can create them in the ui and grab the yml for them too.