Upvote:8
TL;DR: Don't worry, and if you're transiting, choose "yes" for transit.
Unlike most countries, the US does not have a concept of "sterile transit": everybody who flies to the US must enter the US. It thus doesn't matter if you choose "yes" or "no" for transit, you will still have to queue up for Immigration entry. (Obviously, because you are in transit, you should tell the truth and choose "yes".) Once you have passed through, you are in fully in the US, and it's up to you if you board your next flight or go sightseeing.
Also, because ESTAs are weird, you're asked for lots of details about your first trip, but nothing at all about later trips. So first entry in transit and second entry as a regular tourist is also OK. If you want to be 100% safe, though, you can edit your ESTA to update your address in the US even after it has been issued.
Last but not least, in general, if you're eligible for ESTA, your home country is already prequalified. They are thus almost never denied unless you're on a terrorist watchlist or say "yes" to the questions about committing genocide/having Ebola/etc, and even if the ESTA is denied, you can still apply in person for a regular visa. Of course you may still be denied entry to the US on arrival, but this is really unlikely if you have an immediate onward ticket.