This is a non-trivial problem for a couple of reasons.
First, Eulerization of a matrix can produce lots of valid solutions that won't interpolate correctly (if you've ever had to use the blankety-blank Euler Filter in the Maya graph editor, you know what I mean). There are an many of euler combinations that will produce a given Quaternion or rotation matrix. This means it's hard to create a deterministic solution that covers all possibilities.
Second, the tangent along a spline is a vector, but you can't turn the vector into the matrix without at least one other vector to spice the solution. If you're familiar with maya's Spline IK and the complexities of finding a decent frame of reference for the twist control you'll see the same issues here.
Third, and most important for this purpose: twist can't be expressed as a rotation in 3d space -it's a relative rotation in the non-euclidean space of the original curve that doesn't correspond to a consistent world space matrix.
If you want to work with twists you need to construct a frame-of-reference transform for any point on the curve you want to sample, and you need to provide it some kind of extra information to get it started. Since twist is relative, you need to provide a starting point to measure twist from. You'll notice that all native maya tools for working along curves (motion paths, spline IK) do this.
Creating the matrix is pretty simple. get a normalized vector for the curve tangent, and another for the 'up vector'. The up vector is something you'll have to define by convention - that's why all the maya tools that work off of curve geometry tangents require you to pick or provide one. If your curve lies more or less on the XZ plane, you could use the world up vector. If it's more or less vertical, you could use X or Z. However you get it, you need that normalized up vector. Your 'side' vector, the local z axis of your eventual matrix, is the cross product of the tangent vector and the side vector. Now replace the original up vector with the cross vector of the tangent and side vectors (otherwise your matrix will be sheared). Finally, you need the world space position of the point on the curve where you got your tangent.
Now assemble your matrix like this:
tangent.x tangent.y tangent.z 0
up.x up.y up.z 0
side.x side.y side.z 0
pos.x pos.y pos.z 1
That creates a matrix at the sample point, with local x pointing along the curve tangent and local y more or less pointing at the original up vector. In the context of that matrix the twist axis is the local X rotation. It's easier to control twist by creating two transforms: a parent that uses this matrix to provide a frame of reference and a child which is locked on Y and Z and only rotates on X. The euler numbers from the tangent-frame matrix will not be a twist value - twiat in this context is a completely relative concept that can't be expressed in a single matrix!
Honestly, for this kind of thing it may be easier to solve with built in tools. I'd experiment with using a motion path to constrain a reference transform ( a joint or a locator) to the curve: Animation>Motion Paths>Attach to Motion Path. That will do what you're asking by default your X axis will be the tangent of the curve and Y will be world up. You can just parent a second joint to the first (locally zero'ed out) and it's local X will be the twist axis, and you can just lock the other two axes and use that value.
Depending on the shape of your curve, you can run into two different sets of issues. If your up vector is too close to the direction of the curve the solution is unstable. You may be able to fix that by choosing a different 'up' vector - for a vertically oriented curve you could use world Z instead of world Y. However if the curve loops in all 3 dimension there's no mathematically complete solution.
A second strategy is to use extruded geometry to provide an 'up' vector. If you extrude a line segment along your original curve, forming a ribbon with the original curve as the V=0 isoparm, then at any point along the curve you can use the U isoparm as the up vector. That way you can see and if necessary correct the twist along the curve to avoid flips and wobbles - which are otherwise going to be quite common in this situation. You can grab vectors off the surface by using the pointOnSurface command. As long as history is on for your extrusion you can edit or animate the original curve and this solution still works.
Update
In response to OP's further information:
1) I would not worry too much about very large rotations. As jooja points out, this has no precise meaning in the real world that you need to model -- and as a practical matter, only very special purpose characters will ever need it. The biological limit for twist rotations at the wrist is less than +/- 90 and at the shoulder it's even less. A cartoon character could go past that - but probably only in the context of something like a twisting rubber band special effect, not a generic rig.
2) Euler twist is relatively tame, even for 3-axis joints, as long as it is the first euler term (ie, the X in an XYZ rotation). If your arm were laid out without any extra joint orients along the first axis you could measure the accumulated twist by just tracking the first euler rotations (ie, for XYZ bones the chain is a straight length of joints with zero rotations laid out along local X). In that configuration it's easy to add stub bones to counteract the twist rotation with simple expressions or node-based math. You can spread the twist rotation across several bones to keep things smooth (although with modern dual-quaternion skinning this is less of an issue, and two or three bones around the shoulder and the wrist is probably enough). Since the bones are stubs, they don't have to do complex 3d math to figure out twist: a bone in the bicep that's spreading the twist from the shoulder, for example, just rotates something like (-.5 * x) compared to the x rotation of shoulder. You skin to the stub bones, rather than the main line bones, so you get the YZ rotations of the main bone but the modulated X twist of the stubs.
The main drawback to this arrangement is that your bind pose can't also be your zeroed pose: you need the local axes along the chain to be continuous in the 'untwisted' state -- which means your 0,0,0 at the shoulder is a rigid T pose aligned with world X, not the more relaxed posture you get with most models. Animators tend not to like those kinds of zero poses (and of course, if you're matching an existing model you don't have a choice). However you can used dagPose to provide alternate zero poses which are actually zeroed' but do put the character back into a neutral posture.