Nonperturbative formulation of resonances in quantum mechanics based on exact WKB method