Unfortunately this is not possible to do in the most general case. That's because the set of TRS transformations is not closed under composition. Applying one {Translation, Rotation, axis-aligned Scale} transformation followed by another may result in a transformation this is not itself expressible as a single {Translation, Rotation, axis-aligned Scale} trio.
The problem cases arise whenever these two criteria are both met:
This combination results in a net scale that is diagonal to the object's local coordinate axes, so it can't be expressed with a single axis-aligned scale vector.
It can still be expressed as a matrix, since matrix transformations are more general than TRS transformations (able to include shears). The set of matrix transformations is closed under composition (matrix multiplication).
This is the reason why in Unity's transformation API, there are properties for "local" position, rotation, and scale, but for "global" there's only position and rotation. The global scale property is called lossyScale
to communicate that it can no longer be guaranteed to fully represent the scaling applied when multiple transformations are stacked.
If you can guarantee that the later transform(s) will only ever apply uniform scale, then you can compose the transformations like so:
$$
\begin{align}
\bf T_0: & \vec t_0 \quad & \bf T_1: &\vec t_1\\
&\bf r_0 & & \bf r_1\\
& \vec s_0 & & \vec s_1 = \begin{bmatrix}u\\u\\u\end{bmatrix}
\end{align}
$$
$$
\begin{align}
\bf T_c &= \bf T_1 \circ \bf T_0\\
\vec t_c &= \vec t_1 + u\left(\bf r_1 \circ \vec t_0 \right) \\
\bf r_c &= \bf r_1 \circ \bf r_0\\
\vec s_c &= u \vec s_0
\end{align}
$$
This special case (non-uniform scales only at the leaf level) is one we often want to enforce in game object transformation hierarchies for other reasons anyway (eg. skeletal animations or physics), so you may find it's not too onerous to stick to this subset and benefit from easy TRS composition producing TRS outputs.