You need a float switch, and also a solenoid valve.
The solenoid valve needs to be of the type that is normally closed, and only opens when powered.
Have it so that the solenoid switch is connected in series with the float switch. Fit the float switch at the level you want the tap to stop filling.
Now, have your input water from the mains water supply go through the solenoid first, then to the feed the system to fill the tank.
When the water level reaches the float switch, it breaks the connection, the solenoid valve closes, and the water feed is stopped.
You can also connect your booster pump (if you have one) through the float switch too so that it switches off when the water level is full.
That's how I would do it anyway.