Ed Miliband will aim to sharpen Labour's approach to the European Union by saying the party will go into the next election promising an in/out referendum, but only if a government he leads wants to sanction a transfer of power to Brussels.

The shift, agreed by the shadow cabinet, is designed to prevent Labour being portrayed as the anti-referendum party in the European elections in May at a time when hostility to Brussels is gaining public traction. But despite the promise, party sources do not believe that the transfer of power that would trigger the proposed in/out referendum will actually occur.

Ahead of a speech Miliband says: "It is unlikely there will be any such proposals for a transfer of powers in the next parliament, but the British people must know that the history of the EU – as well as uncertainty about precisely what a changing Europe and further integration in the eurozone might involve – means a further transfer of power remains possible."

He promises: "The next Labour government will legislate for a new lock – there would be no transfer of powers from the UK to the EU without a referendum on our continued membership of the EU."

In his speech on Wednesday, Miliband will acknowledge there is public concern about a ratchet effect in which powers are transferred to Brussels, symbolised by the European treaty commitment to "an ever closer union".

Until now, Labour has advocated holding an EU referendum on the proposed specific transfer of power to Brussels, but not on the wider principle of UK's continued membership.

Miliband argues that his commitment to an in/out referendum would require primary legislation after the election of a Labour government, but he will also say he does not currently foresee circumstances in which such a transfer of power would occur.

The Labour leader's move will be the first time the party has held out the prospect of an in/out referendum since Harold Wilson's poll in 1975, although Labour proposed total withdrawal in the 1983 election campaign.

Miliband will also set out a reform agenda for the EU, but rejects the Conservative promise to hold the referendum by 2017, saying the programme is not best achieved by setting an artificial timetable.

He will say: "We can start building alliances in Europe for these reforms immediately, unhindered by divisions in our party or having to negotiate a major new treaty with 27 other member states by 2017."

Responding to Labour's move, the prime minister said on Twitter: "By his own admission, Ed Miliband says it's unlikely there'll be an in/out referendum on Europe under Labour.

"Only the Conservative Party can guarantee and deliver that in/out referendum."

But Labour's intervention was welcomed by Sir Martin Sorrell, head of advertising and media group WPP, who said: "I would say not having a referendum is better than having one.

"Having a referendum creates more uncertainty. The last thing we need is more uncertainty."

Some shadow cabinet sources said they would have preferred an absolute Labour commitment to an in/out referendum, but that would have left Miliband open to the accusation – made against the Tories – that he was leaving a question mark over Britain's continued membership of the EU, and so blighting future inward business investment in the UK.

The shift could also leave Labour exposed to the charge that it has blinked when faced by a possible Ukip surge, when the party has said that any growth in support for Ukip had little to do with Europe.

It also takes Labour's stance closer to that of the Lib Dems, who back a full in/out referendum if there is any proposed transfer of power. But Nick Clegg has suggested a transfer of power will be sought by Britain's EU's partners and that it is a matter of when, not if, there is a sovereignty transfer.

The referendum, Miliband will say, would be triggered by any transfer of power specified in the European Union Act 2011 passed by the coalition parties. That Act sets out not just a transfer as part of a wider treaty change, but also in respect of some specific transfers of competency. Both the Dutch and French key players in any talks on the future of the European Union are opposed to full scale treaty change, but the Germans have said there may be a case for surgical treaty change underpinning new Euro governance arrangements.