Measuring psychological flexibility in medical students and residents: a psychometric analysis