Temporal shifts in antibiotic resistance elements govern phage-pathogen conflicts