Megaloblastic anemia is diagnosed through blood tests, including complete blood counts and specific tests to measure vitamin B12 and folic acid levels. The presence of enlarged red blood cells is a hallmark of megaloblastic anemia.