Probing the evolution of oxygen-bearing complex organic molecules (O-COMs) from ice to gas