With your likely very high job security with the USCG, I'd go ahead and max out your Roth IRA, get your TSP funded for any match, and then contribute to a taxable account beyond that. I'd use your Roth contributions and taxable account "as" your emergency fund, then shift to having your "emergency fund" as just part of your investments once your investment balance is high enough.
Let me explain a bit better: Say you want a $20k emergency fund. Start by
1.a. Put $5.5k in the Roth, invest this in "safe" investments.
1.b. Put in enough to get any matching contribution from your employer (if available)
2. Build up until you have $14.5k in your taxable accounts.
once both of those are done, I'd
3. Continue maxing out the Roth each year.
4. Continue putting getting your max match from the employer.
5. Split remaining available investment money into employer tax advantaged account and taxable accounts (based on what works best for your tax situation etc.)
then, when your Roth contribution amount + taxable brokerage account is sufficiently high for you to feel confident that a major market downturn would still leave enough available for your emergency fund:
6. Invest the "emergency fund" as per your standard asset allocation (money is fungible, so once you have enough that you can supply an emergency fund even in a bad situation it makes sense to me to invest that money so it can grow as well).