Dissecting temporal and spatial dynamics of immunotherapy resistance