Hong Kong resident convicted of espionage, sentenced to life