Sir i would like to ask this question, if the 2 hamilton cutter that would be using by the PN can be upgrade so that they can detect submarines?
Yes, and No. Detection and prosecution of enemy submarines are different concepts.
To detect a presence of a submarine, all you need are passive sonars (hydrophones). You can triangulate a submarine's general position from two passive sensors. You'll need active sonar capability to actually attack a submarine. The main tactical problem with active sonars is that you give away your position.
The effectiveness of sonar varies whether you can vary the hydrophone's depth, and how quiet the surrounding environment is around it. Hull mounted sonars are therefore less effective than tow arrays, and dipping sonars from helicopters miles away from the ship are better. That's why many navies rely upon Anti Submarine Warfare capable helicopters and planes, using dipping sonars or sonar buoys.
While the Hamilton class ships once had a bow mounted sonar and torpedo tubes aboard, they were removed from the entire class after the Soviet Union broke up. The US Coast Guard got out of the ASW business to concentrate of Search And Rescue, Drug Interdiction, and other Law Enforcement missions.
Getting really good at ASW isn't easy or cheap. It's a skill that really takes years of practice. And you'll need submarines around to practice with. It might be better for the PN to prioritize other missions. Even using passive sonar, you'll need two hydrophones in the water, that means having two ships with sonars, two helicopters with dipping sonars, two sonar buoys, or any combination of two sonar sources in the water within detectable range of the sub. One ship with a single helicopter on deployment in the area isn't enough. That's the reason many US Navy ships have large hangers for two helicopters, even with their tow arrays.
I don't think it is necessary for PF15 and later ex-Hamilton class ships to have sonar reinstalled on the bow. An ASW capable helicopter aboard a PF15 could be used for one of the two passive sources needed to find, locate, and eventuality attack a submarine.
But you'll need a second sonar to actually attack or avoid it. Therefore, I believe it would be far cheaper to use heavier, land based helicopters or air planes for initial ASW forces. Deploying from land based bases, they'll be able to practice every day, not just when a ship is deployed. There are several great ASW airframes to choose from. They could also be used for SAR duties.