The hidden side of Ronald Reagan's domestic agenda popped briefly into view last week, and the instant controversy it created suggests that in the long run it may be much more important than the familiar tax and spending cuts he has proposed.

Reagan for years has wanted to bring about a major transformation in the roles of federal, state and local governments. In particular he has wanted to reverse the trend under which the federal government has become a partial guarantor of the incomes and living conditions of the poor.

Put simply, he wants to transfer welfare -- along with assorted other areas of government -- back to the states.

For just as many years, however, governors, state legislators and many county and city officials have been formulating a more complex "sorting-out" scheme for federal, state and local roles. The consensus version would make costly welfare and income-support programs a wholly national responsibility, while removing the federal government from its role as a subsidizer and rule-maker for largely state-and-local-financed education, transportation and police functions.

The debate surfaced last week during the National Governors Association meeting in Washington. The governors were plainly apprehensive about Reagan's proposals to limit future federal funds for health care for the poor. The argument will intensifyamong state legislators, county officials and mayors as Congress digs further into the implications of the Reagan budget in coming weeks.

Two days before Reagan was inaugurated, Sen. Dave Durenberger (R-Minn.), new chairman of the intergovernmental relations subcommittee, told the U.S. Conference of Mayors bluntly that "if I were a governor or a mayor . . . I would be troubled by the talk of . . . returning functions to state and local governments."

"The government that is promoting devolution [sending programs back to the state] is one that cannot afford the many burdens it has inherited and keep the promises it has made," Durenberger said. "Read retrenchment as the synonym for devolution and your perception will be closer to the reality of our current condition."

As some state and local officials read Reagan's first-round budget cuts, retrenchment is what they saw -- and did not like. Budget director David A. Stockman and others offered assurances, but in their resolution, the governors said, "We are prepared to accept budget cuts -- but we will vigorously oppose any attempts to shift costs to state and local taxpayers."

The issue is not a new one in Reagan's political life. In 1975, just before he launched his challenge to President Ford's nomination, Reagan made a speech (written by conservative activist Jeffery Bell) that detailed some $90 billion in federal programs that could could be turned over to states and cities.

In the 1976 New Hampshire primary, the Ford forces took Reagan's "$90 billion plan" and tried to wrap it around his neck. They charged the shift would require a massive increase in state and local taxes. In a state that manages without either an income or sales tax, it was a powerful argument, and Reagan never got off the defensive on the issue.

He lost New Hampshire by a handful of votes, and ever after was ritualistically careful that when he talked about shifting functions from Washington, he always added the phrase, "and the revenues to support them."

When it came to drawing his first presidential budget, however, that proved hard to do, because the federal government needs the money itself. So Reagan has used what he and his aides insist is an "interim" approach.

They have proposed taking about 85, mostly small, categorical aid programs for education, health and social services and lumping them into three block grants -- with discretion for the states and cities in how they use the funds. In turn, federal support for those programs would be cut between 20 and 25 percent from the Jimmy Carter budget, saving about $2.6 billion in outlays.

Despite cries of pain and outrage from some interest groups affected by the cuts, most governors swallowed hard and accepted the medicine. Moving from narrow categorical grants to block granst has been a major goal of state officials for years, and the national organizations of governors and state legislators had jointly proposed last year to swap grant-consolidation for a 10 percent cutback in federal funding.

Although Reagan more than doubled the cost of the deal, the governors for the most part gulped and then agreed. The reason, plainly, was that most saw the cuts as inevitable in this political climate. And they need Reagan's climate. And they need Reagan's help to overcome resistance in Congress to the block grant scheme, particularly from the House Democratic committee chairmen who have protected the categorical programs over the years.

But there was much less acceptance of other parts of the Reagan package, particularly his proposal on Medicaid, the basis federal-state health program for the needy. Costs of this program, mostly borne by the feds, have been exploding. Reagan sought to limit them by putting a 5 percent cap on the 1982 federal contribution, a step that would save the treasury at least $1 billion. In turn, he proposed to revise the program to give the states more leeway to cut their costs.

To most governors, that looked like a dodge. Utah's Scott Matheson, the head of the health task force, said hospital costs are projected to raise 18 percent this year. Instead of asking the states, which pay 10 percent of the hospital bills through Medicaid, to combat hospital-service inflation, he said, let the federal government use the greater leverage of its Social Security Medicare program, which pays 25 percent of all hospital bills, to hold down hospital costs.

An effective 10 percent federal cap on hospital costs, Matheson said, could save the feds $1.6 billion in 1982 and the states hundreds of millions more. The governors endorsed his alternative and said the original Reagan plan was "unacceptable."

Robert Carleson, the White House special assistant developing policy in this area, said the governors' suggestion is "being studied." But its acceptance is unlikely in part because, as Carleson said, "there is a natural reluctance on the part of this administration to go to a Carter-type hospital cost control." President Carter tried twice to get Congress to pass hospital cost controls and was beaten by the hospital lobby.

Beyond that, however, acceptance of the governors' counterproposal would imply Reagan's agreement that the provision of adequate medical care for the needy is primarily a federal responsibility. And, as Carleson made plain in his appearance before the governors, Reagan wants as soon as possible to turn that function, along with other programs he puts in the welfare category, over to states and localities.

"We will be examining virtually all the programs in the federal government for possible removal to state and local government," Carleson, the former California and U.S. welfare commissioner, said. "And we're going to start with the welfare programs" -- Medicaid, food stamps and aid to families with dependent children (AFDC), all of which he categorized as "programs which encourage profligacy."

It is at that point that Reagan's long-held and basic philosophical divergence from the state and local officials' view of federalism becomes starkly apparent.

The consensus view of the partners in the federal system has been hammered out over the years in the Advisory Commission on Intergovernmental Relations.

It suggests that the feds pull out support of programs like education, transportation and law enforcement, where the national government supplies less than 10 percent of the combined federal, state and local expenditures.

But in turn, the ACIR has recommended -- along with the organizations of governors, state legislators and mayors -- that the federal government take over "fundamental social welfare functions," including direct in come support, health, housing and nutrition services for the needy.

At last week's meeting, Gov. Lamar Alexander of Tennessee, a Republican with close ties to the White House, asked Carleson if such a sorting-out of responsibilities would not be "perfectly in accord" with Reagan's professed desire to "let the taxpayers see what level of government is responsible for what functions."

By Carleson rejected that argument. "If your goal is income redistribution," he told Alexander, "there's no doubt the federal government is the most efficient instrument. But President Reagan believes that the welfare programs are not aimed at permanent redistribution of income, but at temporary relief for those most in need. And he believes that you at the state and local levels are far better equipped to determine the extent, the duration and the nature of that need than we are in Washington, so the responsibility should be yours."

After that exchange, Alexander commented he was convicted that Reagan's opposition to a federal takeover of welfare was unalterable, but said he still had hopes there could be a meeting of minds between the governors and Reagan on Medicaid costs.

But Gov. Bruce Babbitt of Arizona, an ACIR member and the strongest public advocate of its sorting-out scheme, was far more biting. "We have a once-in-a-generation opportunity to make sense of the federal system," the Arizona Democrat said at a hearing Durenberger held last week. "But the Reagan administration is approaching this as a question of pure expediency. There is no real philosophy of government behind his approach."

That is probably wrong. There is a philosophy of government -- but it is not the one the governors, state legislators and local officials have been waiting so long to see put into effect.