Okay, let's assume animals (such as scientists) observe things, record them, and react to them without an explicit theory in mind, but there's an implicit epistemological framework that describes how they behave.
It seems like you still need to build your epistemology to match the animals' behaviors, or it's not the one they use? When scientists do math, you need to observe how they actually use math. How do they actually set up and run an experiment or write a paper? It might be different than you imagine?
This is what David Chapman calls the "ethnomethodological flip" [1].
Scientists also might use math differently from how they claim they use it in a formal paper, which doesn't include all the blind alleys and mistakes. A scientific paper is a cleaned-up just-so story.
A fun example of ethnomethodology is studying exactly how a scientist follows the formal procedure for doing a PCR test, including small mistakes that they don't explain and you might not even notice in the demonstration video unless you watch it very carefully, multiple times. [2]
It seems like a very cool thing to do that's rarely done. It might help for coming up with better philosophy?
[1] https://metarationality.com/ethnomethodological-flip [2] https://metarationality.com/rational-pcr
Why that pattern of thought is correct in stating anything is absolutely part of philosophy.
When a person practices science, they are called a scientist. When a scientist exhibits a behavior, that behavior is not necessarily called science.
Also, it seems like there's more to understanding methodology than deciding what counts as science?
To go back to the ant analogy, people had fuzzy ideas about what an ant looks like. Some people might have called other bugs ants even though today we don't. This later led to more precise definitions under scientific taxonomy, where some species are scientifically classified as ants. But there's a lot more to understanding ant behavior than deciding what counts as an ant.
(Also, the definition of what an ant is co-evolved with scientific understanding of ants. Taxonomy existed before the theory of evolution and taxonomies were refined with genetic testing.)
Ants (today) are classified differently from scientists and firefighters. They are not defined based on a specific thing they do, like "anting"; rather, they are defined based on what they are, and their behavior is irrelevant to their classification.
Historically, animal categories were defined much more like professions. A fish was something that primarily swims; a bird was something that primarily flies; a worm was something that primarily slithers; a beast (the category that ants fell into) was something that primarily crawls. Even concepts like "animal" and "plant" were defined this way: animals are animated, while plants are planted in place. There was a lot of debate on how to categorize lifeforms that exhibited less-than-crytal-clear modes of locomotion, just as there is debate today on whether a given person is actually a scientist or not (do they do real science or pseudoscience? do they do a lot of science or is too little science for it to count? etc.).
This, of course, is radically different from the way we classify biological lifeforms now, although there are a few odd historical holdovers (like "fish", which is a catch-all term for aquatic vertebrates without terrestrial ancestors, even though some of them are more closely related to land animals than they are to other fish).
A theory of ants wouldn't "underpin" the behavior of ants. If the ants behave differently than the theory, then the theory is wrong and should be changed. The ant theory is something in the minds of outside observers, not the ants, and ant behavior doesn't rely on it. The dependency goes the other way: the observers modify their theory to better describe the ants. The ants would exist without the theory, but theory would be pointless if there were no ants.
Is a philosophy of science similar? Or does it have a practical effect on scientific work?
Unlike ants, scientists can learn a philosophy of science, and perhaps believe it. Does this affect their work?
One reason it might not affect their work in practice is that they didn't learn that particular philosophy. Also, perhaps different scientists might learn different philosophies without practical effect.