Our Message entity type implements the DefaultHtmlRouteProvider class. There is also the \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider class. This overrides the getEditFormRoute and getDeleteFormRoute and marks them with _admin_route. This will cause these forms to be rendered in the administration theme.