How can I obtain the transfer function from these two transfer functions in this case?
The numerator and denominator of the total system are respectively the convolution of the numerators and the denominators of the filters to be cascaded.
$$
b(n)=b_1(n)*b_2(n)
$$
$$
a(n)=a_1(n)*a_2(n)
$$
You can validate it by the following code in MATLAB
b = conv(b1, b2);
a = conv(a1, a2);

sys1 = dfilt.df2t(b1, a1);
sys2 = dfilt.df2t(b2, a2);
sys = cascade(sys1, sys2);
[b, a] = tf(sys); % convert system object to coefficients