There is a thread and lot of discussion of how to get all user with teacher roles in all courses but none points to the builtin solution.
Solution:
Use bulk user actions, click on more and add the required course role filter, getting all teachers throughout the moodle site.