Military service has transgenerational impact, study shows