The generalized Einstein relation—application to Li+ and Na+ ions in hydrogen gas