How to pass an extra argument to an entity form?
Have a look at https://www.drupal.org/node/2310425

This should explaine everything needed.

Here is an example how it would look like:

mymodule.entityB_add:
  path: '/admin/config/mymodule/{entityA}/{entityB}/add'
  defaults:
    _entity_form: 'mymodule_entityA_entityB.default'
    _title: 'EntityB'
  requirements:
    _entity_create_access: 'mymodule_entityA'
  options:
    parameters:
      entityA:
        type: entity:entity_type_a
      entityB:
        type: entity:entity_type_b