Local dynamic charges from asymptotic expansions of partition functions