The Y axis is set by the (normalized) vector from bone head to bone tail. To change this axis, move the bone tail in edit mode. It may be necessary to remove the "connected" trait from children bones to do this, which is fine; connected trait is nearly useless.
Once you have the Y axis set, X and Z axes can be set by bone roll.
Whenever you change bone axes, you will screw up any existing animations, because those existing animations are measure in terms of local space transformations, and you just changed the local space by changing the axes.
Some other engines (most other engines) use different coordinate handedness, which can screw animations up. The coordinates you show in your pic use a different handedness (but maybe you weren't careful about positive vs negative.) Any decent exporter should be designed to handle differences in coordinate handedness, but you cannot express different handedness inside of Blender. You'll need to convert the animations instead.