how to use transaction between two Model?

how to use transaction between two Model?

every model generated by gii and connected different database. (two databases in the same physical machine).

database: mysql

yii2

Cross-database transactions are supported since MySQL 5.0.3 if you’re using InnoDB.