mysql - calculate traffic for tmp tables
You can go 2 ways: logical and physical calculation.

PERFORMANCE_SCHEMA database has detailed io information about tables and file io. You may need to enable the right monitor metrics to get what you want.

For a physical path, there are multiple tools available. Separate your tmp dir on a different device (a temporary disk, a separate petition or if you cannot do anything else, a loop back device) and you can get detailed stats with some of the many standard Linux utilities or any of the higher level monitoring tools like Prometheus.