Game-theoretic modeling of collective decision making during epidemics