How to get the number of registrants (RNG module) from the theme layer
You can access the event manager service to grab an event meta object. The event meta object contains a bunch of helpers to manipulate registrations and registrants. In your template preprocess functions add whatever data you want from the event meta object.
function mymodule_preprocess_HOOK(&amp;$variables) {
  $event_entity = $entity; // Provide your entity

  /** @var \Drupal\rng\EventManagerInterface $event_manager */
  $event_manager = \Drupal::service('rng.event_manager');
  $event_meta = $event_manager-&gt;getMeta($event_entity);
  $mydata = $event_meta-&gt;whatever(); 
   // See \Drupal\rng\EventMetaInterface for methods. e.g:
   // $event_meta-&gt;getRegistrants()
   // $event_meta-&gt;getRegistrations()
   // $event_meta-&gt;countRegistrations()
   // $event_meta-&gt;getCapacity()
   // $event_meta-&gt;remainingCapacity()
  $variables['myvariable'] = $mydata;
}

For nodes, replace mymodule_preprocess_HOOK with mymodule_preprocess_node and $entity with $variables['node'].