How do I access a custom transform orientation by name in Blender 2.8?
Helper method to get the custom orientation by name from the slots.

Can currently find no way with python to get a list of scene orientations in 2.8. Without I see no way around using a  try except clause.

Here is a "dirty" little script that sets the queried orientation to active if it exists:  Returns the custom orientation from slot 0 then switches back to current.

The operator needs to be run in the context of the 3d view. I used the area type swapping techinique to do this.  Not sure why this is the case either, as it appears to set the orientation scene wide, not per space.  Can you tell I don't use custom orientations much lol

import bpy

def get_co(name, context=bpy.context):
    scene = context.scene
    slots = scene.transform_orientation_slots
    old_co = slots[0].type
    context.area.type = 'VIEW_3D'
    try:        
        bpy.ops.transform.select_orientation(orientation=name)    
        co = slots[0].custom_orientation
    except:
        co = None
    # should be ok and exist
    bpy.ops.transform.select_orientation(orientation=old_co)
    context.area.type = 'TEXT_EDITOR'
    return co

co = get_co("xxx")
if co:
    print(co.matrix)


Thought it would work same as material slots where the slot's material name doubles as the slot name, it appears to be the slot "type" in this instance. 

Neither of the following methods work, as a custom orientation, although you can define many, only inhabits slot 0 if set as default (selected).

import bpy

def get_co(name, scene=bpy.context.scene):
    slots = scene.transform_orientation_slots
    for s in slots:
        if s.type == name:
            return s.custom_orientation
    return None

co = get_co("xxxxx")
if co:
    print(co.matrix)


Similarly looking at custom orientation name

import bpy

def get_co(name, scene=bpy.context.scene):
    slots = scene.transform_orientation_slots
    for s in slots:
        if s.custom_orientation and s.custom_orientation.name == name:
            return s.custom_orientation
    return None

co = get_co("xxxxx")
if co:
    print(co.matrix.to_euler())