Treatment history shapes the evolution of complex carbapenem-resistant phenotypes in Klebsiella spp.