Construction of cospectral graphs, signed graphs and $${\mathbb {T}}$$-gain graphs via partial transpose