MySQL 5.7: Scope of SET TRANSACTION ISOLATION LEVEL for SELECT
(To answer question in comment)

There are three ways to build a transaction:

(1)

BEGIN;
any number of statements  -- all in one transaction
COMMIT;


(2)

SET AUTOCOMMIT = ON;
...
statement  -- This is a transaction
...
statement  -- This is a different transaction


(3)

SET AUTOCOMMIT = OFF;
...
statement
statement
COMMIT;  -- 2 statements in a transaction

statement
statement
COMMIT;  -- another 2 statements in a different transaction