Matrix elements of the generators of IU (n) and IO (n) and respective deformations to U (n,1) and O (n,1)