I am transiting in LA on my way to Sydney, then 5 days later I'm flying back to the US for 8 days. Do I say "Yes, I am transiting" or not? If I put yes, will I have issues when I fly back to the US?
As an ESTA is valid for multiple trips over 2 years, the questions about your stay in the US are all about the first one.
So if you first stay in the US is only transit, you can state so, and it will not affect future travel using the same ESTA, which can be for any stay in the US which qualifies under the Visa Waiver Program.