Find module name in an OS-agnostic fashion
# What does this PR do?

Splitting on `os.path.sep` to get the filename is not fully-compatible on Windows as the OS recognizes a local path written as `folder/file.ext`, but `os.path.sep` is `\\`. Hopefully this way is better.

Fixes #24517
_The documentation is not available anymore as the PR was closed or merged._<|||||>https://github.com/huggingface/transformers/blob/8a968e572c335d82c87dc3708fe0a9da79664d64/src/transformers/dynamic_module_utils.py#L274
This line should be change also~<|||||>Good point, it's added.