When using the_author hook, how can I determine the PHP file that generates each call to `the_author()`?

You can determine the calling files using debug_backtrace in PHP, which will give you the backtrace of the functions called and the file called from. WP core provides wp_debug_backtrace_summary, which makes doing things like this easier. Using the condition stated in your question of being called from my_file.php you could do something like this:

add_filter( 'the_author', 'change_author' );
function change_author($author) {
    if ( false !== strpos( wp_debug_backtrace_summary(), 'my_file.php' ) ) {
        $author = "NEW AUTHOR!";
    }

    return $author;
}

By not passing any args to wp_debug_backtrace_summary it will output the summary as a string. Then we just use strpos to check if my_file.php is included in the output as a calling file and do the changes.

As mentioned by others, this might not be the best approach, but it is easily doable.