Are animation markers part of the timeline or part of an action?
It depends, there are Timeline Markers and Pose Markers.

Timeline markers are stored at scene level, whereas Pose markers are stored in an action:

# Timeline markers of current scene
bpy.context.scene.timeline_markers

# Pose markers for 'CubeAction'
bpy.data.actions['CubeAction'].pose_markers


In the Dope Sheet editor, switch to Action Editor.

Click the menu Marker > Show Pose Markers to see pose markers.

With this enabled, creating markers will add pose markers!
(Pose markers show a diamond-shaped icon)

With Show Pose Markers disabled, you may select Timeline markers (they show a triangular icon) and click Marker > Make Markers Local to convert them to Pose markers. Note that the original Timeline marker will be gone. If you want to keep it, make a duplicate before you convert (ShiftD, Esc).