What is the name of the scientific study of hypothesis formation? As a layperson, I am interested about the scientific method but whenever I search it online I get endless results about how to formulate and test hypotheses for the purpose of writing a scientific paper.

I'm trying to find the term of the process by which people make and test informal theories and hypotheses during their daily lives.

Example
A young child touches an unfamiliar object and, purely by coincidence, there is a distant clap of thunder.  The child 'hypothesized' that the touch caused the clap of thunder. This is now testable because the child can repeat the experiment.

If I want to read more about this in psychology, what do I put in my search engine to avoid getting thousands of results about null hypotheses and t-tests?
One umbrella term is causal reasoning, though this is a bit broader since there are theories of causal reasoning that are not about hypothesis testing.

A Google Scholar search for "causal reasoning psychology" generates several hundred thousand hits, and the first page is full of relevant papers.

Getting more specific, Klayman &amp; Ha (1987) wrote an influential article about the kinds of hypothesis testing you describe. Looking at the papers that cite that article might give you some additional leads into the literature.