Ah, it's a bad news: we have to rely in similar cases on `BeanFactory` `ClassLoader`, So, you should `implements BeanClassLoaderAware` and move initialization logic to the `onIinit()` implementation.
BTW, the `if` above have to be replaced with `StringUtils.hasText(transformerFactoryClass)`