如何使用Magento 2插件的自定义自动加载器

There is a Magento 2 plugin that need to use few non PSR-4 classes. (It is a code shared with different projects.) It is not possible to use php magento -vvv setup:di:compile because that classes cannot be found. Is there a standard place in Magento 2 to declare custom autoloader for a plugin?

P.S.
I found only possibility to use registration.php, but I am told this is an ugly solution.

The question is too vague to answer specifically, could you elaborate further.

Magento 2 has concept of event observer, may be you can create a custom event observable class