If you want the literal text "undergrad" in the brackets, this should work:
cut -d "(" -f 2 <text> | cut -d ")" -f 1
or equivalently
echo <text> | cut -d "(" -f 2 | cut -d ")" -f 1
If this string comes from id, then you can just call id -gn instead.
id
id -gn
var1=$(cmd |sed 's/.*(\([^)]*\))/\1/')