It is common practice to use OIS swaps (as well as futures if available) to compute implied probabilities of interest rate hikes, see for example:
It is not as simple as saying that the 10y rate is 2% and therefore the expectation is 2%. I will provide few explanations below. I will mainly base the idea on futures because it is simpler to compute and more intuitive.
For example, the price of stock futures is simply a function of the spot price, interest rates and dividends and as such contains no information that the spot market does not contain (it's a simple no arbitrage argument).
On the other hand, interest rate futures / OIS rates cannot be calculated from another. There is interesting information inherent in interest rate future prices because the future for March 2023 is completely different from Feb 2024 and price setting relies on market expectations.
The general idea is always the same and looks like this:
- Under the assumption that only central bank actions will impact the effective interest rate of an economy, you can push the expected overnight rates forward and backward through the tenor structure.
- With futures, you get the chain (all tenors) and look at the individual dates. Some contract months will not span central bank meetings, others will. Therefore, you have the future representing the average rate over the period, where it could be higher/lower prior to the meeting date, lower/higher after the meeting date. You can carry the rate forward where there is no meeting - meaning you know the rate prior to the meeting date - and solve the equation:
days_total * Future_meeting_month = days_prior_meeting * Future_prior_m + days_after * r_implied.
To provide a specific example, let's look at the FED Funds futures on Bloomberg. In case you have access to BBG, you can look at {WIRP} and {FFA Comdty CT} for the following screens:

Computing the above logic with the market data results in the following lines of
days_total = 31
days_prior = 2
days_after = days_total - days_prior
future_meeting_month = 3.13
future_prior_month = 3.225
r_implied_may = (future_meeting_month*days_total - future_prior_month*days_prior)/days_after

It is reasonably close to the value Bloomberg shows (3.12) for this meeting date. Note, this is why the 2% is not simply the expectation as long as the (expected) meeting date does not fall exactly on the maturity date of the future / swap (the second bullet point above.
The CME offers a tool similar to WIRP on BBG - the so called CME FED Watch tool, which provides the probabilities just like WIRP.
Apart from futures, you can also look at OIS swaps, which for some countries even have directly quoted central bank meeting date swaps. If not, you can still rely on the following equilibrium:

where the left hand side is the fixed part (r is the quoted OIS price / fixed rate), and the RHS the floating part, with r_i denoting the expected floating rate on the i^th day, d_i the number of days r_i applies for (1 for weekdays, 3 for weekends) and n is the total number of days for the swap. Since r, n and d_i is known, you can solve this.
Strictly speaking, you cannot solve this for a 10 year swap because you will have several rate decision dates in between quoted tenors, as well as a degree of uncertainty about the actual dates of rate decisions. That's why Bloomberg only provides values for about 2 years from today.
However, Bloomberg offers a second tool called MIPR
, where this complication is assumed away and only a simple "basis" adjustment is done in case the policy rate and effective rate is not identical (e.g. Fed Funds mid vs Fed Funds effective rate). This is very much in line with your idea.