Lifetime measurements in the transitional nucleus $^138$Gd