Rosetta compiles JITted code ahead of time, once the OS detects the code exists.
From what I understand, the OS enforces W^X (memory pages that are writable cannot be executable). That means the OS can use the “set page read-only and executable” system calls to detect the existence of JITted code.