As we witness in the scene at Maz Canata's hideaway (where the First Order and the Rebellion are simultaneously alerted to the presence of BB8 at their location), both forces have a significant network of spies and sympathisers. Whilst Fin (being a lowly sanitation worker) bringing them valuable information would suggest that the rebellion don't have anyone inside the First Order passing them intel, it's plausible they have someone close enough to determine that the New Weapon's firing vector was aligned with the direction of the rebel base, and make a reasonable assumption.
Remember, the Weapon is already 'aimed' at the planet when it begins charging from the Sun, so it's giving away it's direction of fire the entire time it's warming up. Enough time for the Rebels to launch a counter assault and attack fleet, so it must take some considerable time.