If you have three points, you can easily determine three basis vectors using the cross product.
From the base you calculate the quaternion.
See also from the Collection of examples from discourse.threejs.org
https://hofk.de/main/discourse.threejs/2021/CarRacing/FlightRouteQuaternion.html
Maybe you can get further with this?