Entity Browser in Forms API
I got a possibly easier solution. you need to have entity_browser and entity_browser_block required as dependencies and installed in your module. Then in your BlockBase buildForm or LayoutDefault buildConfigurationForm you can do something like what they do in the entity_browser_block module in the EntityBrowserBlock.php
// make sure you have this at the top of your file
use Drupal\entity_browser_block\Plugin\Block\EntityBrowserBlock;

// blockForm or buildConfigurationForm
$test = EntityBrowserBlock::loadEntitiesByIDs(explode(' ',$configuration['selection']['entity_browser']['entity_ids']));
$form['selection'] = [
  '#type' =&gt; 'container',
  '#attributes' =&gt; ['id' =&gt; 'entity-browser-block-form'],
];
$form['selection']['entity_browser'] = [
  '#type' =&gt; 'entity_browser',
  '#entity_browser' =&gt; 'classes',
  '#process' =&gt; [
    [
      '\Drupal\entity_browser\Element\EntityBrowserElement',
      'processEntityBrowser',
    ],
    ['\Drupal\entity_browser_block\Plugin\Block\EntityBrowserBlock', 'processEntityBrowser'],
  ],
  '#default_value' =&gt; $test,
];

$order_class = 'entity-browser-block-delta-order';

$form['selection']['table'] = [
  '#type' =&gt; 'table',
  '#header' =&gt; [
    $this-&gt;t('Title'),
    $this-&gt;t('Operations'),
  ],
  '#empty' =&gt; $this-&gt;t('No entities yet'),
  '#tabledrag' =&gt; [
    [
      'action' =&gt; 'order',
      'relationship' =&gt; 'sibling',
      'group' =&gt; $order_class,
    ],
  ],
  '#process' =&gt; [
    ['\Drupal\entity_browser_block\Plugin\Block\EntityBrowserBlock', 'processTable'],
  ],
  '#default_view_modes' =&gt; 'default',
];