Genomics is fundamentally changing epidemiological research. However, exploring hypotheses about pathogen evolution in different epidemiological contexts poses new challenges. Models intertwining pathogen epidemiology and genomic evolution can help understand processes such as the emergence of novel pathogen genotypes with higher transmission or resistance to treatment. In this work, we present Opqua, a computational framework for flexible simulation of pathogen epidemiology and evolution. We use Opqua to study determinants of evolution across fitness valleys. We confirm that competition can limit evolution in high transmission environments and find that low transmission, host mobility, and complex pathogen life cycles facilitate reaching new adaptive peaks through population bottlenecks and decoupling selective pressures. The results show the potential of genomic epidemiological modeling as a tool in infectious disease research.