Following excited-state chemical shifts in molecular ultrafast x-ray photoelectron spectroscopy