Refactor AutoModel classes and add Flax Auto classes
# What does this PR do?

This PR refactors the logic behind all the Auto model classes in one function that automatically builds those classes from a template. In passing, it uses this new function to build the auto classes for FLAX (at least the ones that have at least one model implemented).