So here's the straight scope from the guy who used oversee the testing of recreational boats for compliance with Coast Guard regulations. You can easily calculate the rated horsepower. The formula for a monohull boat less than 20 feet in length with remote steering and a 20 inch (or more) transom height is; the centerline length in feet (for ex. 18 ft 6 in = 18.5) times the maximum transom width (including rub rails) in feet times 2, minus 90. then round to the nearest multiple of five.
example 18.5 X 6.75 X 2 = 249.75 249.75 - 90 =159.75. so the rating would be 160.
The USCG requires a manufacturer to put on a HP rating. The weight of the rated outboard is also used to calculate how much flotation goes into the boat, and maximum persons capacity. The Fed law doesn't apply to boat owners, but there is a big caveat. Many states make it illegal to exceed the rated HP. Insurance companies get nervous if you exceed the HP and may void your policy. Plus the boat may do squirrelly things if you overpower it. Putting a 175 or 180 on a boat rated for 160 may not raise many eyebrows, and may not cause problems, but 300 certainly will. You are adding a lot of weight and the built in flotation to support the motor will not support that weight, So if your boat swamps, which it probably will because it will sit much lower in the stern, will now roll over and dump you and your family in the drink.
Boats 20 feet and up are not required by law to rate the HP, but most do using ABYC standards or a test course to see if the boat is stable with the rated HP, and if it will do any strange things when maneuvering through an ABYC test course or the ISO collision avoidance course. It's their choice. Most boats up to about 26 feet are rated using the formula or the test courses and above that length it's up to the manufacturer.