How do I export animation data stored in actions using the Python API?
You can set an object's action like:

object.animation_data.action = action


But note that you should check first, that animation_data is not None (which is the case for objects with zero keyframes set).

frame_set() is not a bad choice. You could also evaluate the F-Curves one by one and avoid the frame changes, but it's easier to set the frame and get the transformations ready to use (e.g. as 4x4 Matrix). It's also ensured that all modifiers, drivers and such are applied.

Quick F-Curve example:

bpy.context.object.animation_data.action.fcurves[0].evaluate(5)
#~ -3.2612

bpy.context.object.animation_data.action.fcurves[0].keyframe_points[0].co
#~ Vector((1.0, -3.2612))

bpy.context.object.animation_data.action.fcurves[0].keyframe_points[0].interpolation
#~ 'BEZIER'