in the US or another modern country
Sure, the EP allows (in fact mandates) anonymous/secret votes on some matters, mostly personnel ones, but not exclusively.
As for the US, it's pretty much the opposite, and much of that derives from the constitution's wording.
And as I was writing that, James K linked to his prior question that covers the national legislatures of European countries in that regard.
One interesting paper that pops up on search, is one on Italy, and it says that over there, mandatory secret ballot on the final vote on a a bill had a long tradition (but was ended in 1988):
Italy offers an interesting example of the persistence of secret voting from the 1848 constitutional monarchy to the post World War II republican democracy. The Constitution of the Kingdom of Italy (Statuto Albertino) promulgated by King Charles Albert of Savoy in 1848 gave formal recognition to secret voting, making it compulsory for the final vote on bills. Voting through secret ballot at any [other] stage of the legislative process could be requested
by ten deputies or eight senators. [...] Thereafter, both secret voting for the final vote on bills and the norm of giving precedence to secret voting have been applied in the Italian Chamber, with the exception of the Fascist period (1922-1943).
This situation lasted until secret voting for the final vote on bills was abolished in 1988 – one hundred and forty years after its introduction into the Italian Parliament.
As discussed in there, the Italian Constituent Assembly of 1947 also made extensive use of secret balloting, in its works. So you could say Italy's modern constitution was drafted like that. After 1988 though
secret voting could no longer be used in any parliamentary
deliberations that had financial implications.
One country that relatively recently rejected narrowing down that for legislators was Latvia in 2015, but this might be considered a "personnel" matter, because what they rejected is to make their voting for president (which is elected by parliament there) open.
When it comes to elections by legislators in fact, many European countries have similar provisions, as this 2007 COE survey found:
The countries where secrecy of vote is required for elections under the parliamentary rules of procedure are as follows: Albania (under the Constitution, when electing the President of the Republic), Armenia, Austria, Belgium, Finland, France,
Hungary, Lithuania, Moldova (under the Constitution), Monaco, Netherlands, Portugal and San Marino.
I'm not aware of a world-wide survey on this matter, alas.