A Trait XP is earned through daily goals, assignments, and bundles in the official version. However, Star Trek Fleet Command cheats unlock traits automatically.