From wikipedia:
With the emergence of a public sphere and integrated economy in the 18th century, a broader sense of identification with one's country began to permeate society. In England, the early emergence of a patriotic nationalism can be traced to the period 1740-1790 and was spurred on by many of the writers and leading intellectuals of the day. Many symbols of national identity became widespread, such as the Union Flag being increasingly adopted as a national flag, the composition of patriotic songs such as Rule, Britannia! and the creation of John Bull as the personification of Britain by John Arbuthnot.
The movement intensified and became overtly political with the late-18th century American Revolution and French Revolution; specifically the ultra-nationalist party in France during the French Revolution