Unraveling the influence of metabolic signatures on immune dynamics for predicting immunotherapy response and survival in cancer