I think I have basically three advices (and I feel like you already know them):
Don't overthink it. There are millions of reasons why you may not have been a good fit for the position you applied to, and only a small fraction of them depends on you. Internal politics and unspoken needs play sometimes more than the content of your application. Don't blame yourself, that's the best way to get discouraged without being able to take action.
If possible, get inside feedback. If you knew someone in the department where you applied before applying, you may ask them (preferably in a clever way, i.e., not "Why didn't you hire me?" but "Do you have any suggestions for how I could be a stronger candidate in the future?", as pointed by Kimball). You may not get a honest feedback, you may get a disappointing answer ("Well, actually, the chair wanted to hire the lecturer from the beginning"), but it doesn't hurt to ask.
Look for fresh eyes. If you have a friend or a close colleague in the field, ask him / her to review your application (resume, cover letter, statements), your job talk, your teaching presentation (if there was one), and the list of places where you applied. That's the best kind of feedback you can obtain.
If the search committee answered your cold email with a "generic answer", don't insist. You'll never get more details, except, maybe, in a decade or two, at a conference, in a negligent way, by someone who work there.
Also, you may want to look in a couple of months at the listing of the department: you may spot who actually got the job, and compare your profiles. This information may or may not be useful, but it may to some extend satisfy your curiosity