From mott transition to charge-transfer gap in the Emery model