Calculate transformation (Translation, Scaling, Rotation) between two BufferGeometry position state

How can we calculate the transformation matrix (Translation, Scaling, Rotation) from one position attributes state to another.

I have a parent mesh with a BufferGeometry position attributes input that change over time, I need to calculate its transformation matrix when the position attributes change and apply it to its children.

Here is a simplified illustration of my problem : https://jsfiddle.net/uv76tj89/1/

Thanks.