Inheritance-based framework detection
# What does this PR do?

Related to #21761 

Problem: In some functions, we detect the framework of the model class through its name (e.g. if it starts with `TF`). This is a quirk of our library, and users might run into issues due to this hidden behavior. For instance, in the issue linked above, a user created a child class of a TensorFlow model whose name did not start with `TF`, running into exceptions.

Solution: Inheritance-based framework detection :)
cc @Rocketknight1 (FYI :P)<|||||>_The documentation is not available anymore as the PR was closed or merged._<|||||>Now with a test 👍 <|||||>@Rocketknight1 good point! I have no clue if it holds for TF2.5 -- going to double check<|||||>@Rocketknight1 hah, the class is different but it still works! In TF2.4, we have `<class 'tensorflow.python.keras.engine.training.Model'>` in the inheritance tree, so `"keras.engine.training.Mode"` is still a match :D

No change is needed, but thanks for the shoutout 👌 