Charge-transfer energy in iridates: A hard x-ray photoelectron spectroscopy study