Add utility to find model labels
# What does this PR do?

This PR adds a utility function to find the labels of a model. It will be useful for Keras and the Trainer (integration with the first is left for a follow-up PR).
_The documentation is not available anymore as the PR was closed or merged._<|||||>cc @patrickvonplaten for knowledge